[Zope] Generating thumbnails on the fly using PIL

Tom Cameron tom@mooball.com
Tue, 27 Nov 2001 21:41:40 +1000


I am pretty sure you dont _need_ to use a python script. The example simply
uses that as a nice way to call the external method. You can just as easilly
call the method from DTML.

Tom

=> -----Original Message-----
=> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
=> Pieter Claerhout
=> Sent: Tuesday, 27 November 2001 9:33 PM
=> To: 'tom@mooball.com'; zope@zope.org
=> Subject: RE: [Zope] Generating thumbnails on the fly using PIL
=>
=>
=> I had a look at this yesterday, but apparently, you need both an external
=> method and a Python script, and I prefer to have only an external method.
=>
=> Pieter
=>
=>
=> -----Original Message-----
=> From: Tom Cameron [mailto:tom@cameron.to]
=> Sent: Tuesday, November 27, 2001 12:29 PM
=> To: Pieter Claerhout; zope@zope.org
=> Subject: RE: [Zope] Generating thumbnails on the fly using PIL
=>
=>
=> have you read the example on this page
=> http://www.zope.org/Members/michel/ZB/ScriptingZope.html
=> it does not create the thumbnails on the fly, but it does show you how to
=> get the data into stringIO
=>
=> Tom
=>
=> => -----Original Message-----
=> => From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
=> => Pieter Claerhout
=> => Sent: Tuesday, 27 November 2001 9:21 PM
=> => To: '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 )
=> =>
=>
=> _______________________________________________
=> 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 )
=>