[Image-SIG] Can't open image retrieved from S3 with PIL

Kevin J. Smith kevin at rootsmith.ca
Tue Jul 6 08:07:59 CEST 2010


Thanks, Oliver.  That was the trick.

On 5 July 2010 22:46, Oliver Tonnhofer <olt at bogosoft.com> wrote:

>
> On 02.07.2010, at 06:44, Kevin J. Smith wrote:
> > Here is the code:
> >
> > s3 = S3Connection('blah','blah')
> > bucket = s3.get_bucket('my_bucket')
> > key = bucket.get_key(key_name)
> > file = StringIO()
> > key.get_file(file)
> > Image.open(file)
> > # .. here I wish to crop the image before spitting it back to the calling
> environment
>
> Do you get any error? You could try to `file.seek(0)` before opening it
> with PIL.
>
> Regards,
> Oliver
>
>


-- 
Never take life seriously. Nobody gets out alive anyway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20100705/0165f5e5/attachment.html>


More information about the Image-SIG mailing list