how to return a StringIO of an Image

Christoph NOSPAM at xyzxyzxyz.yy
Fri Nov 14 11:27:48 EST 2003


Fredrik Lundh schrieb:

>>   image.save('test', 'JPEG')
>>   image=StringIO(image.????()) # what's the right method?
>>   return image
>>
>>Any hints? Thanx!
> 
> 
>     file = StringIO()
>     image.save(file, "JPEG")
>     return file.getvalue()
> 
That's what I wanted. Perfect!
Thanx a lot!
Christoph





More information about the Python-list mailing list