[Mapserver-dev] New function, msWriteErrorImage()...

Daniel Morissette morissette at dmsolutions.ca
Tue Feb 25 15:02:05 EST 2003


Steve Lime wrote:
> 
> Hi folks: I wanted to add in-image error reporting to the CGI
> application so I pilfered that support from the WMS
> code to create the function msWriteErrorImage. It's basically identical
> to the WMS code so we should be able to
> swap it out, and I'll use it in the CGI too. Might also be a nice to
> have with MapScript although in that case it should
> probably return an imageObj to let the script do the writing. Function
> takes 3 arguments:
> 
>   - a map file (although the size and format args could be passed)
>   - filename (NULL gets you stdout and a MIME type)
>   - blank (true/false, actually toggles writing in the image, WMS needs
> that I guess)
> 
> I've just commited the function, haven't actually placed it anywhere.
> Comments?
> 


I think that's a great idea.  In theory I think it would be better if
the function took (format,w,h) as arguments instead of a mapObj since we
may want to use it in contexts where we don't have a mapObj, but in
practice in MapScript (in PHP anyway) we need to create a mapObj in
order to create an outputFormatObj, so I guess we'll just keep things
like this for now.

To answer your other questions: yes, blank is for WMS, it allows a
client to request that in case of errors he gets a blank transparent
image that won't interefere with the main map.

With respect to exposing the function to MapScript, we could split
msWriteErrorImage() in two parts: the core of it could become a new 
msGetErrorImage() that returns an imageObj.  Then msWriteErrorImage()
would call msGetErrorImage() and write the image to the file.

FYI I have updated mapwms.c to use your function and it seems to work
fine for the WMS case.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-dev mailing list