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

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Jan 3 07:05:02 PST 2012


GD is for GIF only in 6.0+. To get paletted output you can set:


-          IMAGETYPE GIF (GD-based)

-          IMAGETYPE PNG (AGG 8-bit)

-          Setup an output format with like Rich G. mentioned

-          Setup an output format that forces use of a pre-defined palette

OUTPUTFORMAT
    NAME png8
    DRIVER "AGG/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
    FORMATOPTION "INTERLACE=OFF"
    FORMATOPTION "PALETTE_FORCE=TRUE"
    FORMATOPTION "PALETTE=/usr/local/mapserver/apps/mr/compass/compass.palette"
END

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jan Hartmann
Sent: Monday, January 02, 2012 10:45 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Can't get 8-bit palette output

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<http://mapserver.sara.nl/calligo/zl/maps/k1832/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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120103/1bf656f4/attachment.htm>


More information about the MapServer-users mailing list