<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2800.1476" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Hallo.<BR><BR>I 
have Zope 2-7-0 on Linux platform and the following problem :)<BR>I'm sending an 
image through form on the pythonScript. I want script to<BR>resize image and 
save on the zope folder in 3 different size. OK, I use<BR>ExternalMethod which 
uses PIL library to resize these images.<BR><BR>External method:<BR>def 
xImageScale(img_file, maxx, maxy):<BR>&nbsp;&nbsp;&nbsp; from PIL import 
Image<BR>&nbsp;&nbsp;&nbsp; from cStringIO import StringIO<BR>&nbsp;&nbsp;&nbsp; 
im = Image.open(img_file)<BR>&nbsp;&nbsp;&nbsp; im.thumbnail((maxx, maxy), 
Image.ANTIALIAS)<BR>&nbsp;&nbsp;&nbsp; out_file_str = 
StringIO()<BR>&nbsp;&nbsp;&nbsp; im.save(out_file_str, 
im.format)<BR>&nbsp;&nbsp;&nbsp; out_file_str.seek(0)<BR>&nbsp;&nbsp;&nbsp; 
tmp=out_file_str.read()<BR>&nbsp;&nbsp;&nbsp; 
out_file_str.close()<BR>&nbsp;&nbsp;&nbsp; return 
tmp<BR><BR><BR>pyrthonScript:<BR>cAnimation = form.get('cAnimation','') # image 
from the form<BR>if 
cAnimation:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
o.invokeFactory(id='cAnimationS.'+timeStamp, 
type_name='Image',<BR>file=context.xImageScale(cAnimation, 100, 
100)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
o.invokeFactory(id='cAnimationM.'+timeStamp, 
type_name='Image',<BR>file=context.xImageScale(cAnimation, 200, 
200)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
o.invokeFactory(id='cAnimationB.'+timeStamp, 
type_name='Image',<BR>file=context.xImageScale(cAnimation, 
300,300)<BR><BR><BR>The result is "IOError,&nbsp; cannot identify image file". 
So, when I want to<BR>resize and save only one image it works 
properly.<BR><BR><BR>Thanks in advance for any 
help<BR>KK</FONT></FONT></DIV></BODY></HTML>