[Mapit] genmap.fcgi doesn't return images
Bernhard Herzog
bh at intevation.de
Mon Feb 12 11:22:58 CET 2007
Moritz Lenz <moritz at casella.verplant.org> writes:
>>> File "/home/moritz/public_html/mapit/makemap.py", line 78, in
>>> generate_map image = PIL.Image.new("RGB", (result_width, result_height),
>>> 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line
>>> 1610, in new return Image()._new(core.fill(mode, size, color))
>>> SystemError: new style getargs format but argument is not a tuple
>>>
>>> Any idea what might be wrong?
>>
>> The problems seems to arise from PIL somehow.
[...]
> Oddly enough it works when I start genmap explictly with python-2.3
> instead of 2.4, so I'll try to fall back to pyhton2.3.
The issue is probably that 0xFFFFFFFF is a long-int in Python 2.4 while
it was an int in Python 2.3. PIL accepts an int as a color
specification for RGB images. But a long-int is a different python
type, and so PIL tries to interpret the long-int object as a tuple which
leads to the error message above. A simple fix would be to replace the
0xFFFFFFFF with -1. 0x00FFFFFF would probably also work.
Bernhard
--
Intevation GmbH http://intevation.de/
Skencil http://skencil.org/
Thuban http://thuban.intevation.org/
More information about the Mapit
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)