I started playing with the python wrapper for gd from
http://www.boskant.nl/geert/Software/
and it seems to work well with Webware - as an example:
class PNG(ExamplePage):
import gd,sys,time
def writeHTML(self):
img = gd.Image(300, 200, truecolor=1)
pnt = gd.Painter(img)
pnt.setPen(gd.Pen(gd.RGBA(0, 0, 0)))
pnt.setBrush(gd.Brush(gd.RGBA(0,255,255)))
pnt.drawRectangle((0, 0), 300, 200)
font = gd.Font('mediumbold')
pnt.setFont(font)
pnt.drawText((65, 100), time.ctime(time.time()))
img.save(self,format='png')
where "img.save" nicely grabs the write method of self.
I access this from another page with:
self.writeln('<p> <img src="/WK/PNG">\n')
which works for both png & jpeg
I am curious though why I don't need to output
"Content-type: img/jpg\n\n"
from my PNG.py script which I do when outputting
from an Apache cgi.
-
Bill Eldridge
Radio Free Asia
[EMAIL PROTECTED]