Simple script to make .png thumbnails from .zip archive...

Scott David Daniels scott.daniels at acm.org
Sun Jun 18 19:48:04 EDT 2006


hdante wrote:
>  .... there are too many ways to create a thumbnail from an
> image. I'll cite one, using the "python image" external module, that
> I've found to be very easy:
> 
> import Image
> def process(file):
>   try:
>     image = Image.open(file)
>     image.thumbnail ((128,128), Image.ANTIALIAS)
>     image.save (file + '.thumb.png')
>   except:
>     print 'Skipping file', file
> 
>  Links:
>  http://docs.python.org/lib/lib.html - Python Library Reference
>  http://www.pythonware.com/library/pil/handbook/image.htm - The Image
> Module

That, by the way, is the "PIL" library that you'll see a lot about --
The Python Imaging Library that the effbot is justly proud of.  You
won't do better than that.

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list