Hi,
I would like to create images on the fly as a response to an http request.
I can do this with PIL like this (file create_gif.py):
from PIL import Image, ImageDraw
print 'Status: 200 OK'
print 'Content-type: text/html'
print
print 'HTMLHEADTITLEPython Dynamic Image Creation Test/TITLE/HEAD'
On Sun, 28 Aug 2005 09:50:17 + (UTC), Tompa [EMAIL PROTECTED]
said:
Hi,
I would like to create images on the fly as a response to an http
request.
I can do this with PIL like this (file create_gif.py):
from PIL import Image, ImageDraw
print 'Status: 200 OK'
print 'Content-type:
Tompa wrote:
Hi,
I would like to create images on the fly as a response to an http request.
I can do this with PIL like this (file create_gif.py):
from PIL import Image, ImageDraw
print 'Status: 200 OK'
print 'Content-type: text/html'
print
print 'HTMLHEADTITLEPython Dynamic Image
Tompa [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Hi,
I would like to create images on the fly as a response to an http
request. I can do this with PIL like this (file create_gif.py):
from PIL import Image, ImageDraw
check out sparklines:
Benjamin Niemann pink at odahoda.de writes:
You are almost there.
I don't feel so...
Your create_image.py does not return anything to the
browser yet.
Yes, I am aware of that but I do not what to return.
First return proper HTTP headers, e.g.
sys.stdout.write('Status: 200 OK\r\n')
Richard Lewis richardlewis at fastmail.co.uk writes:
It would be useful to know what web server software you're using.
I intended to add that info but forgot...
I run IIS on W2K, python 2.4.1 and PIL 1.1.5.
The other thing you may need to check is the HTTP header of the
generated image.
If
Max Erickson maxerickson at gmail.com writes:
check out sparklines:
http://bitworking.org/projects/sparklines/
It is a script very similar to what you want to do.
This sure looks interesting! Strange that I couldn't find this when I googled
for this kind of stuff...
I will check it out
Tompa wrote:
Benjamin Niemann pink at odahoda.de writes:
You are almost there.
I don't feel so...
Your create_image.py does not return anything to the
browser yet.
Yes, I am aware of that but I do not what to return.
First return proper HTTP headers, e.g.
sys.stdout.write('Status:
Tompa [EMAIL PROTECTED] writes:
The other thing you may need to check is the HTTP header of the
generated image.
If possible I'd rather separate the HTTP/HTML-stuff from image creation.
I'd like to have an HTML file that refers to a py-file that creates images
which are returned somehow