[Image-SIG] PIL problem
Thomas Clive Richards
thomi at thomi.imail.net.nz
Sat Aug 14 06:41:40 CEST 2004
I'm trying to make a quick script which generates thumbnails for a website.
However, I can't get the thumbnail() method to work with PNG files.
I'm using python2.2 (and I can't upgrade unfortunately - that's what is being
used on the webserver).
Here's a quick outline of the problem:
>>> import Image
>>> im = Image.open("/tmp/pics/title.png")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 1264, in
File "/usr/lib/python2.2/site-packages/PIL/ImageFile.py", line 192, in load
raise IOError(error + " when reading image file")
IOError: unknown error when reading image file
At this point however, If I repeat the thumbnail() cal, there are no errors.
The following block continues from where the above block left off:
The saved image seems to be valid (the GIMP will open it), but the contents
are garbled, and look NOTHING like the original.
This script works fine with GIF, BMP and JPG formats.
Does anyone know of an easy fix for this?
thomi at once.net.nz
More information about the Image-SIG