generating images in a CGI using mapscript

John Cartwright John.C.Cartwright at NOAA.GOV
Tue Nov 14 17:56:45 EST 2006


Hello All,

I'm trying to use Sean's example 
(http://mapserver.gis.umn.edu/docs/howto/mapscript_imagery) to directly 
output a map image from a CGI  using python mapscript.  The pertinent 
lines are:

map_image = map.draw()
print "Content-type: " + map_image.format.mimetype + "\n\n"
map_image.write()

The cgi runs fine at the command line and even seems to generate a valid 
GIF image once the Content-type line is removed. 
However, running this in a browser seems to return an image that does 
not display but instead shows the alternate text of  "The image ... 
cannot be displayed, because it contains errors." No error is logged w/ 
apache for this request.

Can someone point out what I'm doing wrong here?

Thanks!

-- john



More information about the mapserver-users mailing list