[Image-SIG] Unable to load dynamic image into browser
JMarsh at marshintprop.com
Mon Dec 24 21:35:28 CET 2012
I do not seem to have success in generating a dynamic image into Internet
Explorer through CGI. If I save the file and then load it, it works but
when I try to keep the generated image dynamic. I am using Python 2.6.5 and
the corresponding PIL library.
f = cStringIO.StringIO()
print "Content-type: image/png\n"
The above will just generate a screen filled with ascii characters and
symbols. I have also tried JPEG to no avail.
Below generates a blank image:
sys.stdout.write('Status: 200 OK\r\n')
sys.stdout.write('%s' % f.getvalue())
Can someone point out my error here? Writing to file in a cgi environment
is not a great thing to be doing. Img.sav('test.png') is valid.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Image-SIG