[Zope] Problem with ThumbNail Image

Sylvain Boureliou sylvain.boureliou@msg-software.com
Tue, 4 Sep 2001 15:50:55 +0200


Hi all

I would like to create a thumbnail from a jpeg file.
Here is the fonction i use :

def ThumbNail(self):
    import Image, os, sys
    texte = "ok"
    img = Image.open("essai.jpg")
    img.thumbnail((50, 50))
    img.save('essaiThumbnail.jpg', "JPEG")
    return texte

The file "essai.jpg" is in the Zope directory.
It works very well from the Python command line, but it doesn't work when i
use it in an external method.
Zope finds the file but this error is raised :

(i'm using Zope 2.4 win32 - Python 2.1 - PIL 1.1.1)
Error Type: IOError
Error Value: cannot identify image file
....
File C:\Program Files\zope\Extensions\ScriptsEpinet.py, line 24, in
ThumbNail
  File c:\python21\pil\Image.py, line 902, in open
IOError: (see above)


Thanks very much for help.

Sylvain