melinath / django-daguerre

On-the-fly image manipulation for Django.
http://django-daguerre.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
85 stars 15 forks source link

"Fit" adjustment flexible upscale behavior #72

Open harrislapiroff opened 9 years ago

harrislapiroff commented 9 years ago

Currently the "Fit" adjustment will scale an image up if the image is smaller than the measurements provided. Oftentimes a template designer may want an image to fit within a container, but not scale it up if it's small. This should be an option.

Proposed solution: add an upscale argument to the "Fit" adjustment. (And maybe add it to some of the other adjustments as well.) E.g.,

{% adjust my_model.image "fit" width=200 height=200 upscale=False %}

(Not married to using False. Could use "no" or whatever.)

We could also change the default behavior to disable upscaling by default.