Automatic thumbnails generation

Firstly seen in 'nesh' Django utilities library, thumbnail.py makes web designers work as easy as possible. The approach is quite different from many others, since now web designer (and not programmer) makes decision about how page would look, and software does all the dirty job generating thumbnails when required.

How it works

  1. Make sure that DjHDGutils are installed. Here is guide how to install DjHDGutils.
  2. Add filter to any of your image. Allowed filter parameters:
    • width
    • height

(both weight and height can be speificied)

Those parameters could restrict the miniatire size by wihth, or height (or both).

As soon as template is saved, this change will be seen immediately.

That is how you specify it in template (a few typical usage examples):

Here is example from albums.html of my  personal blog project

{% load thumbnail %}
<img border="0" src="{{ photo.get_photo_url|thumbnail:"width=180,height=180" }}" alt="{{photo.title_en}}">

Here is another example which limits image size by width only:

{% load thumbnail %}
<img width="113" border="0" src="{{ product.get_picture_url|thumbnail:"width=113" }}">