Re: Moving Images to Amazon S3

2007-06-01 Thread Kyle Fox
SanPy, Thank you! This works awesome and does exactly what I need! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubs

Re: Moving Images to Amazon S3

2007-05-31 Thread SanPy
One addition: On 31 mei, 21:35, SanPy <[EMAIL PROTECTED]> wrote: > Try this: > # in your view > raw_image_data = form.cleaned_data['photo']['content'] > thumbnail_content = resize_image(raw_image_data) > filename = form.cleaned_data['photo']['filename'] Change the filename's extension to jpg, be

Re: Moving Images to Amazon S3

2007-05-31 Thread SanPy
Try this: # in your view raw_image_data = form.cleaned_data['photo']['content'] thumbnail_content = resize_image(raw_image_data) filename = form.cleaned_data['photo']['filename'] upload_to_s3(filename, thumbnail_content) def resize_image(buf, size=(100, 100)): f = cStringIO.StringIO(buf)

Re: Moving Images to Amazon S3

2007-05-31 Thread Kyle Fox
I think my question wasn't clear: we're having NO problem putting files on S3, that's dead simple (ie what Holovaty blogged about). What we need to do is take an *in-memory Image* and put it directly onto S3. We need a way to convert a PIL Image instance into a format S3 can accept WITHOUT havi

Re: Moving Images to Amazon S3

2007-05-31 Thread Nic James Ferrier
"=?ISO-8859-1?Q?Fr=E9d=E9ric_Sidler?=" <[EMAIL PROTECTED]> writes: > openfount provide something that does the trick > http://www.openfount.com/blog/s3dfs-for-ec2 > > and adrian holovaty did something like that some weeks ago for > chicagocrime.org > http://www.holovaty.com/blog/archive/2006/04/0

Re: Moving Images to Amazon S3

2007-05-31 Thread Frédéric Sidler
openfount provide something that does the trick http://www.openfount.com/blog/s3dfs-for-ec2 and adrian holovaty did something like that some weeks ago for chicagocrime.org http://www.holovaty.com/blog/archive/2006/04/07/0927 2007/5/31, Nic James Ferrier <[EMAIL PROTECTED]>: > > > Kyle Fox <[EMAIL

Re: Moving Images to Amazon S3

2007-05-31 Thread Nic James Ferrier
Kyle Fox <[EMAIL PROTECTED]> writes: > The S3 API requires the file data to be in the format the > open(myfile).read() returns (whatever that is). > > Is there a way to get the same data from an in-memory Image instance, > so I don't need to save/re-read/delete each thumbnail file? Surely the be

Moving Images to Amazon S3

2007-05-30 Thread Kyle Fox
I'm absolutely stuck on this. This question might be more python than django related, but I figured because it deals with Amazon S3, someone here may know how to handle it. Here's what needs to happen: 1. A user uploads an image (part of a Model we have) 2. Create a 100x100 thumbnail using PIL