djangosnippets.org: Latest snippets tagged with 'scale'https://djangosnippets.org/tags/scale/2010-09-29T17:49:55.335600-05:00ResizeImageField
2010-09-29T17:49:55.335600-05:00wimhttps://djangosnippets.org/snippets/2212/<h1>ResizeImageField</h1>
<h1>(extension of RemovableImageField)</h1>
<p>by Wim Feijen, Go2People.</p>
<h2>What does it do?</h2>
<p>ResizeImageField is a replacement for django's ImageField. It has two major benefits:
1. Creation of thumbnails and scaled images.
1. Extends the image upload form and adds a preview and a checkbox to remove the existing image.</p>
<p>It's …</p>
Freely redistributableCrop and scale image to a given size
2007-05-10T08:45:28.393657-05:00rpwhttps://djangosnippets.org/snippets/224/<p>Prerequisites: <a href="http://www.pythonware.com/products/pil/">Python Imaging Library</a></p>
<p>This function scales a given image (provided as binary data in any format the PIL supports) to a specified size.</p>
<p>If the force parameter is True, the function makes sure that the resulting image is exactly the specified size, cropping and scaling it as necessary (but …</p>
Freely redistributable