[prev in list] [next in list] [prev in thread] [next in thread]
List: zope-cmf
Subject: [Zope-CMF] Re: StringIO error
From: Rainer Thaden <thadi () gmx ! de>
Date: 2003-06-26 13:57:44
[Download RAW message or body]
RT> i have a little script makeThumbnails which automatically generates
RT> thumbnails of images on certain pages. In most cases it works. But in
RT> some cases i get the following error:
RT> 8<------- snipped first part --------->8
RT> Module Script (Python), line 8, in makeThumbnails
RT> - <PythonScript at /CMFTest/ITA/makeThumbnails used for /CMFTest/ITA/ITA/Mitarbeiter/jkl>
RT> - Line 8
RT> Module Products.ITA.ita_utils, line 66, in makeThumbnail
RT> TypeError: expected string, ImplicitAcquirerWrapper found
RT> The code is here:
RT> from PIL import Image
RT> from cStringIO import StringIO
RT> import os.path
RT> # create a thumbnail image file
RT> original_image=getattr(self, original_id)
RT> # the line below must be responsible for the error i think:
RT> original_file=StringIO(original_image.data)
RT> image=Image.open(original_file)
RT> image=image.convert('RGB')
RT> image.thumbnail((size,size))
RT> thumbnail_file=StringIO()
RT> image.save(thumbnail_file, "JPEG")
RT> thumbnail_file.seek(0)
RT> The image is a jpg, which is uploaded in a Portal Image.
RT> Any ideas?
Anyone who's interested:
Think i found it:
http://www.zopelabs.com/cookbook/1010702887
--
Regards,
Rainer mailto:thadi@gmx.de
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic