Reputation:
I am building a web app using Django.
I want users to be able to upload photos using an upload form, and then on submission, the server side code takes the photo, make thumbnails for it and also resize the photo to different sizes, each saved as a separate file. These files will be used for display at a later time. Is going with PIL the best way to do this?
Also, if I want to upload these photos to S3, what libraries would you recommend?
Thanks in advance!
Upvotes: 0
Views: 1758
Reputation: 77335
For uploading your images to s3 you can also checkout something like Django queued storage https://github.com/jezdez/django-queued-storage it allows you to upload the file to your local server, and then in the background it uploads it to s3 for you.
I'm not sure if it will work for the flow that you are describing out of the box so you might need to play with it a little in order to get the cropping of the images finished before you upload to s3.
Upvotes: 0
Reputation: 1531
Take a look at this: http://djangothumbnails.com/
If your asking specifically about how to handle file uploads in Django without a third party module look at my answer on this post: Simple Django Image Upload - Image file not saving and use PIL to do everything yourself.
As @John Keyes said, use http://code.google.com/p/boto/ for S3.
Upvotes: 1
Reputation: 5604
For your S3 (and other AWS needs) boto is great.
And for thumbnailing etc. PIL will do the job for you.
Upvotes: 0