[Image-SIG] Streaming Images

Joao S. O. Bueno Calligaris gwidion at mpc.com.br
Mon Jan 31 15:24:21 CET 2005


On Friday 31 December 2004 18:49, Jalil Feghhi wrote:
> I would like to create an image on the fly and stream it to the
> browser. Is there any information on how to do this exactly using
> PIL (or any other library)? In my python program, I am converting a
> random text to an image. I can serve it to the browser now but I
> hae to save it to a file. I like to stream it and not save it to
> file system. How is this possible?
>

Hi.

I do that with PIL -
all you have to do is to send to the HTTP server a http header line 
apropriate for the data you are serving.

If you are writing Python CGI, the server reads your stdout, so just 
doing:
print "Content-type: image/png\n\n"
prior to outputing  image data should do it.


Cheers,
	JS
	-><-


> Regards,
>
> -Jalil


More information about the Image-SIG mailing list