[mapserver-users] Can't get 8-bit palette output

Richard Greenwood richard.greenwood at gmail.com
Tue Jan 3 08:53:29 EST 2012


On Mon, Jan 2, 2012 at 9:44 AM, Jan Hartmann <j.l.h.hartmann at uva.nl> wrote:
> Happy New Year, all.
>
> I'm porting my applications from MapServer 5.7 to 6.0.1, and I am unable to
> get 8-bit palette output. The MapScript commands are:
>
>     $oMap->outputformat->set('driver','GD/PNG');
>     $oMap->outputformat->set('imagemode',MS_IMAGEMODE_PC256);
>
> which give me the following warning, and no image:
>
> Warning: mapObj::draw() [mapobj.draw]: [MapServer Error]: agg2CreateImage():
> AGG2 driver only supports RGB or RGBA pixel models
>
> I tried every combination I coud think of, with GIF and GDAL, and got always
> the same result. MapServer was compiled with gd-support:
>
> MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
> SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
> SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR
> INPUT=GDAL INPUT=SHAPEFILE
>
> Any idea, someone?
>
> Jan


Jan,

I was hoping that someone more knowledgeable then me would answer your
question. I generally use GIF for PC256 images and the default 6.0 GIF
output should work. I do not use mapscript. My PC256 PNG map file
definition is as follows:

OUTPUTFORMAT
  NAME png
  DRIVER "AGG/PNG"
  MIMETYPE "image/png"
  IMAGEMODE PC256
  EXTENSION "png"
  TRANSPARENT on
END

I have had some problems with rendering quality of PC256 images in
6.0. I posted two bug reports which were quickly addressed but are not
yet in a release so you might want to build from svn source.

Happy new year to you also.
Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the mapserver-users mailing list