<!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> from PIL import
Image<BR> from cStringIO import StringIO<BR>
im = Image.open(img_file)<BR> im.thumbnail((maxx, maxy),
Image.ANTIALIAS)<BR> out_file_str =
StringIO()<BR> im.save(out_file_str,
im.format)<BR> out_file_str.seek(0)<BR>
tmp=out_file_str.read()<BR>
out_file_str.close()<BR> return
tmp<BR><BR><BR>pyrthonScript:<BR>cAnimation = form.get('cAnimation','') # image
from the form<BR>if
cAnimation:<BR>
o.invokeFactory(id='cAnimationS.'+timeStamp,
type_name='Image',<BR>file=context.xImageScale(cAnimation, 100,
100)<BR>
o.invokeFactory(id='cAnimationM.'+timeStamp,
type_name='Image',<BR>file=context.xImageScale(cAnimation, 200,
200)<BR>
o.invokeFactory(id='cAnimationB.'+timeStamp,
type_name='Image',<BR>file=context.xImageScale(cAnimation,
300,300)<BR><BR><BR>The result is "IOError, 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>