Image Streaming

Steffen Brodowski st.brodowski at
Wed Jul 9 16:22:04 CEST 2003

Hi Ian,

> > 
> > import Image, ImageDraw
> > def CreateBarcode(SourceString,Linewidth,WriteText):
> >     blablabla
> >     ...
> >     NewImage ="L",NewSize,Backcolor)
> >     ImgDraw = ImageDraw.Draw(NewImage)
> >     ....
> > 
> >     #How to put the image into an stream?
> have that function return the image object.  Then, assuming you are
> doing this in CGI (easily adapted if not), do something like (untested):
> import sys
> image = CreateBarCode(...)
> print 'Content-type: image/jpeg\n'
>, 'JPEG')

I think its more difficult.

The function CreateBarcode has to return the image directly.
Additional you have to know, that I have to implement it into Zope. So
I use the script as an "external method".  Modulname=Barcode,

I'm using the following line in Zope DTML
<dtml-var "barcode(SourceString='123456789',Linewidth=1,WriteText=0)">
<img src="<dtml-var "barcode128(SourceString='123456789',Linewidth=1,WriteText=0)">">

to generate the barcode and for showing it on a html-site.

But is doesn't run.

Do you have any ideas?


Steffen Brodowski

More information about the Python-list mailing list