[Mapserver-users] gd-png: fatal libpng error: Invalid number of colors in palette

Lowell Filak lfilak at medinaco.org
Mon Jun 16 08:25:23 PDT 2003


Make sure your code is NOT starting a new imageObj to draw on using "new
mapscript::imageObj()" but rather create it like the following:
my $legend_img = $class->createLegendIcon($map,$layer,200,100);
$class->drawLegendIcon($rmap,$layer,150,50,$legend_img,25,25);
The above works because createLegendIcon adds the map palette to the new
canvas image whereas:
my $legend_img = new mapscript::imageObj(200,100);
does not work because mapscript::imageObj does not add the map palette.
HTH
Lowell F.

The following message was sent by "pkishor_98"
<pkishor at geoanalytics.com> on Sat, 31 May 2003 04:43:51 -0000.

> In my continuing (unsuccessful) adventures with drawLegendIcon, I have
encountered 
> --
> 
> gd-png:  fatal libpng error: Invalid number of colors in palette
> gd-png error: setjmp returns error condition
> 
> --
> 
> does anyone have any idea what is going on? btw, other commands (such as 
> createLegendIcon) work just fine.
> 
> Mapserver 3.6, perl.
> 
> Tia,
> 
> Puneet.
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list