Hi All,<br><br>I'm having problems using the AGG renderer with Python mapscript.  I believe it may be due to the way in which I am writing the image into a cStringIO.StringIO() object, but I'm not sure.  I do know that if I comment out my OUTPUTFORMAT section of the mapfile, I get an image back in my browser. I'm hoping I can fix this somehow with a FORMATOPTION.<br>
<br>- Below is the mapscript and Python CGI:<br>#! /usr/bin/python<br><br>import mapscript<br>import cStringIO<br><br>def DrawMap():<br>    mapfile = "/var/www/mapfiles/gis_layers/gis_layers.map"<br>    mapobject = mapscript.mapObj(mapfile)<br>
    mapimage = mapobject.draw()<br>    f = cStringIO.StringIO()<br>    mapimage.write(f)<br><br>    print "Content-type: image/png\n"<br>    f.seek(0)<br>    print f.read()<br>    print mapimage<br><br>if __name__ == "__main__":<br>
    DrawMap()<br><br>- And here is the OUTPUTFORMAT section that's causing the problem:<br>OUTPUTFORMAT<br>  NAME 'AGG'<br>  DRIVER AGG/PNG<br>  IMAGEMODE RGB<br>END<br><br>Thanks,<br><br>Roger<br>--<br>