1

I want to make sure an image that will be saved stays inside the border of my specific dimensions and scales down if any of its dimensions exceed these specific dimensions.

I will be using a gallery for my website using django and the width and height of it is certain, If I use crop while saving an image to keep dimensions under control, it crops a part and as a result doesn't act as I wish.

How can this be achieved ?

Hellnar
  • 62,315
  • 79
  • 204
  • 279
  • 2
    possible duplicate of [resize image on save](http://stackoverflow.com/questions/623698/resize-image-on-save) also [image-resizing-with-django](http://stackoverflow.com/questions/1164930/image-resizing-with-django) – agf Aug 21 '11 at 20:22
  • Those don't seem like (exact) duplicates to me as OP is asking to resize image within constraints rather than asking for resizing in general. – Tim McNamara Aug 21 '11 at 20:35

1 Answers1

0

You should really look at http://thumbnail.sorl.net/ (especially http://thumbnail.sorl.net/template.html#options), it will solve this and many other problems that you may encounter later.

Riz
  • 817
  • 1
  • 8
  • 21