Opened 19 years ago

Closed 19 years ago

#1084 closed defect (fixed)

creating image object from stringIO fails on windows

Reported by: sgillies@… Owned by: sgillies@…
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.4
Severity: major Keywords:
Cc:

Description

Hobu has modified his strcasecmp to avoid NULLs, otherwise he gets segfaults.
Below is an error that is raised.  I think it should be msImageLoadGDCtx,
not *Stream.

======================================================================
ERROR: draw a map using the set image symbol
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:\cvs\mapserver\mapscript\python\tests\cases\symboltest.py", line 70,
in setUp
    symb_img = mapscript.imageObj(s)
  File "../../build\lib.win32-2.3\mapscript.py", line 970, in __init__
    newobj = _mapscript.new_imageObj(*args)
MapServerError: msLoadImageGDStream(): GD library error. Unable to initialize image

Change History (1)

comment:1 by sgillies@…, 19 years ago

Resolution: fixed
Status: newclosed
The main problem is that on windows, Python image files need to be opened in
'rb' mode:

>>> imfile = open('tests/xmarks.png', 'rb')
>>> image = mapscript.imageObj(imfile)

Added an else{} to catch the case of failed driver detection with a very 
verbose message.

Note: See TracTickets for help on using tickets.