<div dir="ltr"><a href="http://mapserver.org/mapscript/php/phpmapscript.html#members">http://mapserver.org/mapscript/php/phpmapscript.html#members</a><br><div><br></div><div>labelObj<span style="white-space:pre"> </span>label<span style="white-space:pre"> </span>Removed (6.2) - use addLabel, getLabel, ...<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 11:34 AM, Tim Banchi <span dir="ltr"><<a href="mailto:tim.banchi@gmail.com" target="_blank">tim.banchi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 01/31/2014 11:23 AM, Tim Banchi a écrit :<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
with the upate from ubuntu 13.04 to 13.10 the package python-mapscript moved from 6.0.1 to 6.2.1. Since then I get the the following runtime error:<br>
<br>
img = mapscript.imageObj(fname)<br>
File "/usr/lib/python2.7/dist-<u></u>packages/mapscript.py", line 1324, in __init__<br>
this = _mapscript.new_imageObj(*args)<br>
MapServerError: imageObj(): Image handling error. imageObj() is severely broken and should not be used<br>
<br>
<br>
The mapscript API suggests that mapscript.imageObj could be used normally. So I added the ubuntugis-unstable repository and updated python-mapscript to 6.4.0, but the error stays.<br>
<br>
I didn't find anything usefull searching the internet for this error message, so I wonder whether imageObj is really broken or whether the error is caused by something else?<br>
I'm not busy with mapscript, I have to maintain the program where mapscript is part of. Can I use another function instead mapscript.imageObj which gives me back an image object?<br>
<br>
The function where mapscript.imageObj(fname) is invocated is as follows:<br>
<br>
def load_custom_symbols(self):<br>
        lst_symbols = [ os.path.splitext(x) for x in<br>
                        os.listdir(os.path.join(os.<u></u>getcwd(), "_symbols")) ]<br>
<br>
        for symbol, ext in lst_symbols:<br>
            if ext == ".png":<br>
                fname = os.path.join(os.getcwd(), "_symbols", "".join([symbol, ext]))<br>
                symbol = mapscript.symbolObj(symbol)<br>
                img = mapscript.imageObj(fname)<br>
                symbol.type = mapscript.MS_SYMBOL_PIXMAP<br>
                symbol.setImage(img)<br>
                self.map.symbolset.<u></u>appendSymbol(symbol)<br>
<br>
Thanks!<br>
Tim<br>
</blockquote></div></div>
Hello,<br>
<br>
in case anybody else is wondering about these problem when moving from 6.0.1. to 6.2.1:<br>
<br>
After I learned that also labels where not working any more with 6.2. or 6.4:<br>
<br>
eg:<br>
class_layer = layer.getClass(i)<br>
class_layer.label.type = mapscript.MS_TRUETYPE<br>
<br>
caused:<br>
<br>
  File "/usr/lib/python2.7/dist-<u></u>packages/mapscript.py", line 841, in <lambda><br>
    __getattr__ = lambda self, name: _swig_getattr(self, classObj, name)<br>
  File "/usr/lib/python2.7/dist-<u></u>packages/mapscript.py", line 54, in _swig_getattr<br>
    raise AttributeError(name)<br>
AttributeError: label<br>
<br>
<br>
I locked python-mapscript to the raring version (6.0.1) and since then everything is normal again: imageobj can be instantinated and labels are working as before<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
______________________________<u></u>_________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/mapserver-<u></u>users</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/mapserver-<u></u>users</a><br>
</div></div></blockquote></div><br></div>