djangosnippets.org: Latest snippets tagged with 'thumb'https://djangosnippets.org/tags/thumb/2011-02-04T03:04:50.328726-06:00Template Tag of Django Image Thumb Creator
2011-02-04T03:04:50.328726-06:00ayang23https://djangosnippets.org/snippets/2348/<p><strong>You can save these codes into a templatetag file in your django app. Then use codes like these in your template files:</strong></p>
<hr />
<pre><code>{% load *yourtags* %}
...
<img src="{% thumb *yourmodel.picturefield* 200 300 0 %}"/>
<img src="{% thumb *yourmodel.picturefield* 500 400 yes %}"/>
...
</code></pre>
<p>The parameters are:</p>
<pre><code>imagefield ImageField
width …</code></pre>
Freely redistributable