[Image-SIG] Using PIL to display resized images over the web

Terry Hancock hancock at anansispaceworks.com
Wed Oct 15 22:15:19 EDT 2003


On Wednesday 08 October 2003 05:49 pm, Steven M. Castellotti wrote:
> 	I have a simple photo website written in python. I would like to be
> able to use Python Imaging Library to read an image file from the disk,
> resize/thumbnail it in memory, and then print the modified image
> (sending it to the client web browser after the proper MIME headings).

If you were to use Zope, you could do this trivially with my VarImage
product, which you can download at http://www.anansispaceworks.com/papers_html .

OTOH, in the apparently more likely event that you don't want to use Zope,
you'll find foveal thumbnailing and other operations in the Operator sub-
directory of the VarImage distribution, which may be of use to you.  This
code passes file-like objects using the StringIO module in Python, which
avoids actually writing a temporary file.  You should be able to use something
similar even in a plain CGI environment.

Either way, I hope this helps you out,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the Image-SIG mailing list