PIL and cgi

Mathieu zehp at netcourrier.com
Tue Mar 7 19:43:22 CET 2000


i'd like to use PIL for make picture on the fly, i try 


#!D:\Program Files\Python\Python.exe

from cStringIO import *
import Image

img = Image.open('tmp.jpg')

tmp = StringIO()
img.save(tmp, 'JPEG')
tmp.seek(0)
image = tmp.read()
  
print '''\
Content-type: image/jpeg
Content-length: %s

%s''' % (len(image), image)

but, the picture lokks strange, like she was shuffled, where is the
mistake?
it was done on Apache 1.3, Pil 1.0, Python 1.52 on an NT4

thanks.

M.



More information about the Python-list mailing list