Hi All,<br><br>I&#39;m having problems using the AGG renderer with Python mapscript.&nbsp; I believe it may be due to the way in which I am writing the image into a cStringIO.StringIO() object, but I&#39;m not sure.&nbsp; I do know that if I comment out my OUTPUTFORMAT section of the mapfile, I get an image back in my browser. I&#39;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>&nbsp;&nbsp;&nbsp; mapfile = &quot;/var/www/mapfiles/gis_layers/gis_layers.map&quot;<br>&nbsp;&nbsp;&nbsp; mapobject = mapscript.mapObj(mapfile)<br>
&nbsp;&nbsp;&nbsp; mapimage = mapobject.draw()<br>&nbsp;&nbsp;&nbsp; f = cStringIO.StringIO()<br>&nbsp;&nbsp;&nbsp; mapimage.write(f)<br><br>&nbsp;&nbsp;&nbsp; print &quot;Content-type: image/png\n&quot;<br>&nbsp;&nbsp;&nbsp; f.seek(0)<br>&nbsp;&nbsp;&nbsp; print f.read()<br>&nbsp;&nbsp;&nbsp; print mapimage<br><br>if __name__ == &quot;__main__&quot;:<br>
&nbsp;&nbsp;&nbsp; DrawMap()<br><br>- And here is the OUTPUTFORMAT section that&#39;s causing the problem:<br>OUTPUTFORMAT<br>&nbsp; NAME &#39;AGG&#39;<br>&nbsp; DRIVER AGG/PNG<br>&nbsp; IMAGEMODE RGB<br>END<br><br>Thanks,<br><br>Roger<br>--<br>