djangosnippets.org: Latest snippets posted by micheltshttps://djangosnippets.org/users/michelts/2007-04-19T07:56:00.643164-05:00micheltsFilter to resize a ImageField on demand
2007-04-19T07:56:00.643164-05:00micheltshttps://djangosnippets.org/snippets/192/<p>A filter to resize a ImageField on demand, a use case could be:</p>
<p><code><img src="object.get_image_url" alt="original image">
<img src="object.image|thumbnail" alt="image resized to default 200x200 format">
<img src="object.image|thumbnail:"200x300" alt="image resized to 200x300"></code></p>
<p>The filter is applied to a image field (not the image url get from <em>get_image_url</em> method of the model), …</p>
Freely redistributable