[Zope] problems with images and PIL
Lauri Posti
lauri@mutabor.ee
Tue, 4 Apr 2000 23:32:53 +0200 (EET)
Hi,
There is a strange problem with PIL. a code similar to
-----
def foo(im):
sio=StringIO.StringIO(im)
i=PIL.Image.open(sio)
i.resize((newx,newy))
of=StringIO.StringIO()
i.save(of,"jpeg")
return of.getdata()
------------
Throws following exception inside Zope but works well in plain python.
Any suggestions?
Zope Error
Zope has encountered an error while publishing this resource.
exceptions.IOError
Sorry, a Zope error occurred.
Traceback (innermost last):
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 214, in
publish_module
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 165, in
publish
File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: manage_addPicture)
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 102, in
call_object
(Object: manage_addPicture)
File Newsitem.py, line 167, in manage_addPicture
(Object: ElementWithAttributes)
File Newsitem.py, line 104, in resize_image
IOError: (0, 'Error')