[Image-SIG] First time with PIL

Richard Jennings zaphod.beeblebrox at freesurf.ch
Sat May 1 02:16:29 EDT 2004


Hi,

I have been using python for sometime and am ecstatic about it.
I tried to use PIL for the first time today and I can't get past base 1:

Python 2.2 & PIL 1.1.3 on SusE 8.2

My first script was:

import Image

def center(orImagePath):
    im = Image.open(orImagePath)
    new = im.copy()
    im.save('result.png')

if __name__ == '__main__':
    center('oliverLSig.png')

and generated the error:

Traceback (most recent call last):
  File "./magicTest.py", line 13, in ?
    center('oliverLSig.png')
  File "./magicTest.py", line 9, in center
    new = im.copy()
  File "//usr/lib/python2.2/site-packages/PIL/Image.py", line 497, in copy
    self.load()
  File "//usr/lib/python2.2/site-packages/PIL/ImageFile.py", line 166, in load
    raise IOError, "decoder error %d when reading image file" % e
IOError: decoder error -3 when reading image file

Other applications can read the .png
I have confirmed that ZLIB and JPEG libs are installed.
I don't know where to start to debug this, can anybody help, please?

TIA



More information about the Image-SIG mailing list