Thanks for all your replies. I ended up using sorl-thumbnail, which I had already installed, but I didn't think it kept aspect ratio of image because you are required to enter w and h for thumbnail image size using ThumbnailField. A quick test shows that it resizes and keeps same aspect ratio. So, I am able to upload a file and save it to a ThumbnailField as smaller version, which is all I needed. Thanks!
On Mar 18, 7:03 am, Alex Robbins <alexander.j.robb...@gmail.com> wrote: > I think Satchmo useshttp://code.google.com/p/sorl-thumbnail/ > I think it uses PIL underneath a layer of abstraction. That might work > for you if you are just wanting to generate alternate versions of > uploaded images. > > Alex > > On Mar 18, 12:10 am, robinne <develo...@computer-shoppe.net> wrote: > > > I can save an uploaded image to a FileField like this (where > > "ProductFile" is a model) and "TempFile" is an ImageField: > > > uploadedfile = request.FILES['uploadfile'] > > ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(), > > TempFile=uploadedfile) > > > But, how do I manipulate the image size and then save to this model? I > > am working with PIL, but I can't save a PIL Image to a ImageField. Can > > I save the file to disk using PIL and then pass in the file path and > > name to the model? If so, what is the syntax for saving the ImageFile > > when you are no longer working with the original uploadedfile object? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.