Hello Jeff,

Thanks for the reply.
Your answer was in my junk folder, sorry for the delay ^^'

I found where the error was coming from, if it can interest someone else.
My MapFile has thematics (many CLASS with EXPRESSION in LAYER), and some cases 
use an external GIF resource defined in my SYMBOLSET.
It was not well defined, and I also have to change these from GIF to PNG, and 
now all works well.

Best regards

JCB

-----Message d'origine-----
De : MapServer-users <mapserver-users-boun...@lists.osgeo.org> De la part de 
Jeff McKenna
Envoyé : lundi 7 novembre 2022 18:08
À : mapserver-users@lists.osgeo.org
Objet : Re: [MapServer-users] readGIF error meaning ?

Hello JC,

If you are using MS4W, you can test a GetLegendGraphic request by using the 
local demo WMS service that comes with every MS4W install, out-of-the-box, such 
as:

https://ms4w.dev/cgi-bin/mapserv.exe?MAP=/ms4w/apps/local-demo/local.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=getlegendgraphic&layer=countries&FORMAT=image/png

(you should be able to modify the url above for 127.0.0.1/ instead)

If that works locally for you, just follow the local-demo.map, for your own 
mapfile.

-jeff


--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training co-founder of 
FOSS4G http://gatewaygeo.com/




On 2022-11-07 11:23 a.m., Jean-Christophe Bastin wrote:
> Hello,
> 
> I have many map files and I’m trying to get legends from them.
> 
> I followed the documentation I found : 
> https://mapserver.org/ogc/wms_server.html#getlegendgraphic-request 
> <https://mapserver.org/ogc/wms_server.html#getlegendgraphic-request>
> 
> The map file I test follows the requirements. I tried many calls :
> 
> http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.0.0
>  
> <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.0.0>
> 
> http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.1.0
>  
> <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.1.0>
> 
> http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.1.1
>  
> <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.1.1>
> 
> http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.3.0&SLD_VERSION=1.1.0
>  
> <http://127.0.0.1/cgi-bin/mapserv.exe?MAP=C:/mywms.map&SERVICE=WMS&layer=mylayer&REQUEST=getlegendgraphic&FORMAT=image/png&VERSION=1.3.0&SLD_VERSION=1.1.0>
> 
> Each of them give me the error :
> 
> readGIF(): General error message. corrupted gif image?: Failed to read 
> from file
> 
> What does that mean ? Am I missing a parameter in my call or something 
> more in the map file that is not in the documentation ?
> 
> Or is it the kind of generic error “I can’t generate your legend, just 
> find by yourself why” ? XD
> 
> Many thanks !
> 
> *JCB*
> 


_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to