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,
The Imagefile is just a pointer to file. Here is what I do to upload
and resize an image. I hope it helps.
file_to_open = settings.MEDIA_ROOT+'//profiles//'+
user.username+'-'+file.name
fd = open(file_to_open, 'wb+')
if file.multiple_chunks():
for chunk in file
I think Satchmo uses http://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 wrote:
> I can save an uploaded image to a Fil
On Mar 18, 6:10 am, robinne 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=uploade
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
5 matches
Mail list logo