Chris Hare wrote:
> 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?
You need to rewind to the start of the buffer before trying to read from it:
self.imageBuffer.seek(0)
--
Gareth Rees
_______________________________________________
Image-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/image-sig