[Image-SIG] Basic problem

Fredrik Lundh fredrik@pythonware.com
Tue, 11 Aug 1998 14:24:50 +0100

>I seem to have neglected some initial setup task. I get the following error
>regardless of what image file I attempt to open. (lena.gif, lena.ppm, lena.jpg)
>"test.bmp"   was made from the Microsoft Paint program.
>>>> import Image
>>>> im = Image.open('c:/proj/wavelet/test.bmp')
>Traceback (innermost last):
>  File "<interactive input>", line 1, in ?
>  File "C:\Python\modules\pil\imaging\Image.py", line 731, in open
>    raise IOError, "cannot identify image file"
>IOError: cannot identify image file
>I'm using Win95 with Pyth151.exe and pil.zip from the same download page.

try this:

>>> import Image
>>> Image.init()
>>> Image.OPEN
{'PNG': (<class PngImagePlugin.PngImageFile at 89a880>, <function _accept at 898
b80>), ... lots of similar items in random order ... })}

if the dictionary is empty, you must make sure that the image drivers
(the *ImagePlugin.py files) are in a directory along the Python search

Cheers /F