[Zope] Problems with ImageFile

Juan Pablo Romero jpablo@perl.ajusco.upn.mx
30 May 2002 17:01:17 -0500


Hello


I'm trying to create an image using PIL within an external method. I
followed the 'makeThumbnail' example, from the Zope book. This is some
of the code:

----------------------
import Image, ImageDraw
from StringIO import StringIO
...
im = Image.new( ... )
...
sf = StringIO()
im.save(sf, "JPEG")
...
----------------------

when executed within zope, this code gives an error message, saying
something about "...'ImageFile' module has no attribute '_save'..."

So I looked for ImageFile, and found that PIL (1.1.3) has his own
ImageFile module:

	Zope-2.5.0-linux2-x86/lib/python2.1/site-packages/PIL/ImageFile.pyc


 (the one that should be imported within the 'save' method above), but
instead, Zope's own ImageFile module gets imported:

	Zope-2.5.0-linux2-x86/lib/python/ImageFile.pyc

What is the proper solution?


Regards,


  Juan Pablo