[mapserver-users] Create imageObject failed in python binding.

Umberto Nicoletti umberto.nicoletti at gmail.com
Mon Aug 19 00:45:43 PDT 2013


Shawn,
I have briefly checked the python mapscript sources and I am afraid the you
might have hit a bug.
Python mapscript has a special, more pythonic imageObj constructor which
seems to depend heavily on GD code
and that possibily explains the error you are experiencing.

Would you mind opening an issue at:

https://github.com/mapserver/mapserver/issues/new

Please state the mapserver version and, if built from sources, the options
used.
It would greatly speed up the resolution process if you could build
mapserver/mapscript from the git sources.

BR,
Umberto


On Sun, Aug 18, 2013 at 4:59 AM, Shawn Gao <gaohawk at gmail.com> wrote:

> Hi, All,
>
> Official document on mapserver site said use following way to create an
> imageObject instance in python. look at this link<http://mapserver.org/mapscript/mapscript.html#imageobj>
>
> new imageObj( int width, int height [, outputFormatObj<http://mapserver.org/mapscript/mapscript.html#outputformatobj> format=NULL
> [, string filename=NULL ] ] ) : imageObj
>
> So I create imageObject in Python by this,
>
> mapscript.imageObj(100,100,"GD/PNG", '
> http://mapserver.org/_static/banner.png')
>
> But get error, "Segmentation fault (core dumped)".
>
> Then I check the test case of python binding. The test case for
> imageObject is in imagetest.py. I try it firstly. Then many cases failed,
> include the case for create imageObject instance. I found the create method
> in test script is in other way.
>
>     def testConstructorUrlStream(self):
>         """imageObj with a URL stream works"""
>         url = urllib.urlopen('http://mapserver.org/_static/banner.png')
>         imgobj = mapscript.imageObj(url, 'GD/JPEG')
>         assert imgobj.thisown == 1
>         assert imgobj.height == 68
>         assert imgobj.width == 439
>         imgobj.save('testConstructorUrlStream.jpg')
>
>
> What's the correct way to create an imageObject from url or file?
>
> Thanks,
> Shawn
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130819/c8b8b5b5/attachment.htm>


More information about the MapServer-users mailing list