[Zope] PIL: can't call same method twice

Chris chris-zopemailing at gmx.de
Fri Mar 4 18:09:06 EST 2005


Hi,

I encounter a problem, that I can not explain at all:

I have an external method to resize an image (see below). I can call the 
method without a problem from a script within Zope and it does it's job.
Hovever, if I call it twice within the same script, I get the error "can 
not identify image" although the same FileUpload instance is passed.

My (dummy-)script looks something like this:
# call the ext. method 'resize' one or more times
x=1                         # does not work for x >1
image=context.REQUEST.image # passed from a html-form
for i in range(0,x):
     foo = context.resize(image, size=size)

the external method 'resize' looks like this:
def resize(self, image, size=200, resample='ANTIALIAS'):
    from PIL import Image
    image=Image.open(image)
    [...]

I have no idea what the problem could be or where to look.

Any advice would be a greate help.
Regards Chris


More information about the Zope mailing list