[mapserver-users] python + mapscript + PIL
    Norman Vine 
    nhv at cape.com
       
    Sun Mar  3 11:54:37 PST 2002
    
    
  
Vic Kelson writes:
>
>I have it all working now, python 2.1 with mapscript and it's great. 
>Now, I have a question.  I can make an image using:
>
>   import mapscript
>
>   m = mapscript.mapObj('...')
>   p = m.draw()
>
>and I get a gdImagePtr in p.  I made this work:
>
>   mapscript.msSaveImage(p,'myfile.png',MS_PNG,0,0,0)
>
>and I can make a PNG file on disk.  Neato.  Then I load the image from
>disk with PIL and I can tweak it.  Question: Is there a direct way to
>make a PIL image from the gdImagePtr returned by mapObj.draw()?  It
>would make my application a LOT easier...
You need to read this
http://www.python.org/doc/current/lib/module-struct.html
Cheers
Norman
    
    
More information about the MapServer-users
mailing list