[Zope] Generating thumbnails on the fly using PIL

marc lindahl marc@bowery.com
Tue, 27 Nov 2001 11:16:15 -0500


Check out my ImageTag Core Patch
(http://www.zope.org/Members/bowerymarc/ImageTag_Hotfix)

Which does exactly that.

> From: Pieter Claerhout <Pieter_Claerhout@CreoScitex.com>
> Date: Tue, 27 Nov 2001 12:20:43 +0100
> To: "'zope@zope.org'" <zope@zope.org>
> Subject: [Zope] Generating thumbnails on the fly using PIL
> 
> Hi all,
> 
> I'm trying to make an external method that creates a thumbnail of an image
> on the fly. I want to give it the url of the image and return the image
> data. It should look something like:
> 
> <dtml-var "MakeThumb('/path/to/my/image.jpg', (64, 32))">
> 
> I figured out already that I should use a StringIO object to store the raw
> image data in, so that PIL has an object to work with. The only two things
> I'm struggling with still are:
> 
> - How do you get the data of the image in the StringIO object?
> - How do you return the thumbnail image?
> 
> Hope that somebody can help with this.
> 
> Cheers,
> 
> 
> Pieter
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )