[mapserver-users] "mapscript.imageObj(): is severely broken and should not be used" after upgrade from 6.0.1 to 6.2.1/6.4.0
Tim Banchi
tim.banchi at gmail.com
Fri Jan 31 02:23:48 PST 2014
Hello,
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:
img = mapscript.imageObj(fname)
File "/usr/lib/python2.7/dist-packages/mapscript.py", line 1324, in __init__
this = _mapscript.new_imageObj(*args)
MapServerError: imageObj(): Image handling error. imageObj() is severely broken and should not be used
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.
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?
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?
The function where mapscript.imageObj(fname) is invocated is as follows:
def load_custom_symbols(self):
lst_symbols = [ os.path.splitext(x) for x in
os.listdir(os.path.join(os.getcwd(), "_symbols")) ]
for symbol, ext in lst_symbols:
if ext == ".png":
fname = os.path.join(os.getcwd(), "_symbols",
"".join([symbol, ext]))
symbol = mapscript.symbolObj(symbol)
img = mapscript.imageObj(fname)
symbol.type = mapscript.MS_SYMBOL_PIXMAP
symbol.setImage(img)
self.map.symbolset.appendSymbol(symbol)
Thanks!
Tim
More information about the MapServer-users
mailing list