matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

Display image with dynamic height #447

Closed hungphamvn closed 6 years ago

hungphamvn commented 6 years ago

Firstly, thank you for your awesome project.. And i just have a little bit doubt about this, I created a thumbnail image with processor below: processors = [ResizeToFit(width=290)] and i don;t know how to display it at template. i tried to use {% thumbnail '290x' image.image as th %} but it return cache image.. Could anyone help me? thank a lot.

vstoykov commented 6 years ago

Look at {% generateimage %} documentation. When {% thumbnail %} is used as assignment tag the result is the same as using {% generateimage %} as assignment tag. http://django-imagekit.readthedocs.io/en/latest/#generateimage

If you directly want to work with the cache image from your model (with ImageSpecField) then look here: http://django-imagekit.readthedocs.io/en/latest/#using-specs-in-templates