new imageObj::write(), user contributions needed

Sean Gillies sgillies at FRII.COM
Thu Oct 14 13:59:31 PDT 2004


Greetings mapscripters,

The SWIG mapscript modules for the 4.4 release will contain a new
imageObj::write() method that can be used to write image data to an
open filehandle.

This method requires, for each target language, a SWIG typemap to
convert between your favorite language's file object and a C FILE*.
I've written the one for Python, and this is it:

   // Translate Python's built-in file object to FILE *
   %typemap(python,in) FILE * {
       if (!PyFile_Check($input)) {
           PyErr_SetString(PyExc_TypeError, "Input is not file");
           return NULL;
       }
       $1 = PyFile_AsFile($input);
   }

I don't do any mapscripting with languages other than Python, and so
am neither motivated nor well prepared to test typemaps for other
languages.  This is why I am looking for user contributions!  Please
contribute patches against mapscript.i to issue 941 in our bugzilla:

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=941

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the MapServer-users mailing list