[Mapserver-users] PNG Files are shown black

Frank Warmerdam warmerdam at pobox.com
Fri Aug 8 06:00:41 PDT 2003


Manfred.Zerndl wrote:
> Hi List,
> 
> I have to display many PNG rasterfiles in one layer mapserver.
> It works fine in Mapserver 3.6.4 !!!!
> But when i try to show the layer in Mapserver 4.0 the output remains 
> black!!!!
> 
> i have Mapserver 3.6.4 built as
> MapServer version 3.6.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ 
> SUPPORTS=TTF SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT INPUT=EPPL7 
> INPUT=JPEG INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE
> 
> and Mapserver 4.0 built as:
> MapServer version 4.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ 
> SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=JPEG 
> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
> 
> when i run   gdalinfo   on on of the png rasterfiles, the output is:
> Band 1 Block=500x1 Type=Byte, ColorInterp=Gray
> 
> the programm xv tells me:
> PNG, 1 bit grayscale (non-interlaced)
> 
> Is there a magic mapserver configure option I missed in 4.0?
> Or can I doe some declatations in the mapfile, that is needed since 4.0? 
> I have tried to set some new OUTPUTFORMAT Sections, but with no success.

Manfred,

In 3.6.x you were likely going through the GD based PNG import which I
suspect treats on pixels in a 1 bit file as white while GDAL will treat them
as grey level 1.

Try setting a classification with black for class 0 and white for class 1.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the MapServer-users mailing list