[Zope-dev] cStringIO strange errors

Tor Oskar Wilhelmsen toroskar at chello.no
Fri Jul 9 12:57:59 EDT 2004


Hi
I'm using the code below to fetch an image from a database, and for inserting the image as an Image object in ZOPE. The strange thing is that the code causes python to crash, but sometimes it work (for 1 of 10 or something like that). Im using Python 2.3.3 for Windows and Zope 2.7.0 for windows. I don't get any indication about what causing the error, but testing leaves me with an error on the code below. Does anyone know what  I have done wrong?

imthumb = PIL.Image.open(StringIO(pic[3]))            #pic[3] is the blob from the db
imthumb.thumbnail(tsize)                                    
btfil = StringIO()
imthumb.save(btfil,"JPEG")
btfil.seek(0)
#thumbnail title
thumbnailtitle = str(pic[1])
self.manage_addProduct['OFSP'].thumbnails.manage_addImage(thumbnailid,btfil,thumbnailtitle,"","image/jpeg")
btfil.close()



- Tor Oskar Wilhelmsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-dev/attachments/20040709/4fc62564/attachment.htm


More information about the Zope-Dev mailing list