<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV><FONT face=Arial size=2>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).&nbsp;Im using Python 2.3.3 for Windows and Zope 
2.7.0 for windows.&nbsp;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&nbsp; I have done wrong?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>imthumb = 
PIL.Image.open(StringIO(pic[3]))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
#pic[3] is the blob from the 
db<BR>imthumb.thumbnail(tsize)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>btfil = 
StringIO()<BR>imthumb.save(btfil,"JPEG")<BR>btfil.seek(0)<BR>#thumbnail 
title<BR>thumbnailtitle = 
str(pic[1])<BR>self.manage_addProduct['OFSP'].thumbnails.manage_addImage(thumbnailid,btfil,thumbnailtitle,"","image/jpeg")<BR>btfil.close()</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>- Tor Oskar Wilhelmsen</FONT></DIV></BODY></HTML>