return image in mod python

Abandoned besturk at gmail.com
Mon Nov 19 14:45:22 CET 2007


On Nov 19, 12:36 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Abandoned wrote:
> > Hi i have a 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.
>
> Really? I don't see any error. So there can't be one.
>
> Diez

It gives me this error:
    req.sendfile(im)

TypeError: argument 1 must be string, not instance

Sendfile uses as:
req.sendfile("C:/img.jpg")
But i don't know how can i return when i use PIL before return ?



More information about the Python-list mailing list