okay - I have an error but I don't understand what I got wrong:

self.imageBuffer = StringIO.StringIO()
image = Image.open(filename)

image = image.resize((150,150),Image.ANTIALIAS)
image.save(self.imageBuffer, format= 'PNG')

image = Image.open(self.imageBuffer)

IOError: cannot identify image file

The error occurs when trying to open the imageBuffer so I can work with the 
data in the buffer.  What have I missed?

On Apr 27, 2012, at 8:21 AM, Charles Cazabon wrote:

> Chris Hare <ch...@labr.net> wrote:
>> 
>> I am stuck however, in figuring out how to take the string data and
>> converting it back to an image that I can put into the canvas widget.
> 
> See the PIL handbook, where it says "If you have an entire image file in a
> string, wrap it in a StringIO object, and use open to load it."
> 
> Charles
> -- 
> ------------------------------------------------------------------
> Charles Cazabon                   <charlesc-pyimage...@pyropus.ca>
> Software, consulting, and services available at http://pyropus.ca/
> ------------------------------------------------------------------
> _______________________________________________
> Image-SIG maillist  -  Image-SIG@python.org
> http://mail.python.org/mailman/listinfo/image-sig

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to