djangosnippets.org: Latest snippets posted by rpwhttps://djangosnippets.org/users/rpw/2007-05-10T08:45:28.393657-05:00rpwCrop 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