how can i return a image in mod python ?

Arnaud Delobelle arnodel at googlemail.com
Mon Nov 19 11:27:59 EST 2007


On Nov 19, 10:27 am, Abandoned <best... at gmail.com> wrote:
[...]
> Thank you but i have a another problem.
>
> def showimage(req):
>         from PIL import Image
>         im=Image.open("c:\image-2.jpg")
>         im.thumbnail((800,600), Image.ANTIALIAS)
>         req.sendfile(im)
>
> give me some error.
> How can i return this image witdhout save ?

You can use the cStringIO module (http://docs.python.org/lib/module-
cStringIO.html).

HTH

--
Arnaud




More information about the Python-list mailing list