Ruby/Mapscript: howto to send image on-the-fly?

sduc gamilcairo sduclos.cairo at GMAIL.COM
Tue Jul 18 10:22:46 EDT 2006


Hi,

The doc (mapscript.txt) say that write() work only for Python

write( [ FILE file=NULL ] ) : int
    Write image data to an open file descriptor or, by default, to *stdout*.
    Returns MS_SUCCESS or MS_FAILURE.

.. note:: This method is current enabled for Python only.  User-contributed
   typemaps are needed for Perl, Ruby, C#, and Java.


But is there a way around this?


What I'm trying to do is something like this:

  def do_GET(req, res)
    map = get_map()
    img  = map.draw()

    res.status = 200
    res["Content-Type"] = img.format.mimetype + "\n\n"

    img.write()
  end

But this dump a GIF on the server side !

Any hint or an example would be great


Thanks,

Sylvain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060718/e020f0ee/attachment.html


More information about the mapserver-users mailing list