[Zope] PIL: convert an image-object back to file object

Jens Vagelpohl jens at zope.com
Thu Nov 13 19:50:37 EST 2003


> As I want to do the changes on-the-fly, I pass the fileUpload instance 
> from my HTML-form to a python script. The script calls a external 
> method. The external method uses PIL to convert the fielUpload 
> instance to a PIL.Image.Image instance, does some stuff and returns 
> the PIL.Image.Image instance to the python script.
>
> In the script I want to save the returned object as an Zope image 
> object using manage_addImage(). But the manage_addImage method expects 
> a file object, not a PIL.Image.Image.

Save the PIL Image into an intermediary cStringIO instance and pass 
that one into manage_addImage.

jens


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2355 bytes
Desc: not available
Url : http://lists.zope.org/pipermail/zope/attachments/20031113/e1a9c244/smime.bin


More information about the Zope mailing list