Re: Dynamic image creation for the web...

2005-08-29 Thread Fredrik Lundh
"Tompa" <[EMAIL PROTECTED]> wrote: > Yes, I believe so too. Something like this, as suggested by Benjamin: > sys.stdout.write('Status: 200 OK\r\n') > sys.stdout.write('Content-type: image/gif\r\n') > sys.stdout.write('\r\n') > im.save(sys.stdout, "GIF") > > But it does not work for some reason!?

Re: Dynamic image creation for the web...

2005-08-28 Thread Mike Meyer
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 som

Re: Dynamic image creation for the web...

2005-08-28 Thread Benjamin Niemann
Tompa wrote: > Benjamin Niemann 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(

Re: Dynamic image creation for the web...

2005-08-28 Thread Tompa
Max Erickson 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 - thanks

Re: Dynamic image creation for the web...

2005-08-28 Thread Tompa
Richard Lewis 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 possible I'd

Re: Dynamic image creation for the web...

2005-08-28 Thread Tompa
Benjamin Niemann 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') > sys.s

Re: Dynamic image creation for the web...

2005-08-28 Thread Max Erickson
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: http://bitworking.org/projects/sp

Re: Dynamic image creation for the web...

2005-08-28 Thread Benjamin Niemann
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 'Python Dynamic Image Creatio

Re: Dynamic image creation for the web...

2005-08-28 Thread Richard Lewis
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 'Conte

Dynamic image creation for the web...

2005-08-28 Thread Tompa
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 'Python Dynamic Image Creation Test' print '' im = Image.new("P