[mapserver-users] OUTPUTFORMAT png 16-bits

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Wed Feb 5 05:57:26 PST 2020


Hi,

But it is GDAL that is supposed to write the png because of
DRIVER GDAL/PNG

GDAL does support UInt16 fot png but it does not support int16. Perhaps this has something to do with the problem.

-Jukka Rahkonen-

-----Alkuperäinen viesti-----
Lähettäjä: Eichner, Andreas - SID <Andreas.Eichner at sid.sachsen.de> 
Lähetetty: keskiviikko 5. helmikuuta 2020 13.05
Vastaanottaja: Johannes Paul <johannespaul92 at gmail.com>; Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: mapserver-users at lists.osgeo.org
Aihe: AW: [mapserver-users] OUTPUTFORMAT png 16-bits

Hello Johannes,

16bit-PNGs are IMHO not supported by MapServer. Although libPNG supports 16bit depth (see http://www.libpng.org/pub/png/libpng-1.2.5-manual.html#section-4.3) MapServer only supports 1, 2, 4 and 8bit palettes (see https://github.com/mapserver/mapserver/blob/master/mapimageio.c#L355).

HTH

-----Ursprüngliche Nachricht-----
Von: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Im Auftrag von Johannes Paul
Gesendet: Mittwoch, 5. Februar 2020 11:33
An: Rahkonen Jukka (MML)
Cc: mapserver-users at lists.osgeo.org
Betreff: Re: [mapserver-users] OUTPUTFORMAT png 16-bits

Hello Jukka,
Thanks for your reply, i've changed mimetype but i still get the 8-bits png...
Johannes 

Le mer. 5 févr. 2020 à 11:09, Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi> a écrit :


	Hi,

	 

	I would make a test by using some other mimetype, like image/png16, for eliminating the possibility that some internal  png configuration drives over your own outputformat.

	 

	I don’t know if it helps but it is cheap to test.

	 

	-Jukka Rahkonen-

	 

	Lähettäjä: mapserver-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Johannes Paul
	Lähetetty: keskiviikko 5. helmikuuta 2020 12.03
	Vastaanottaja: mapserver-users at lists.osgeo.org
	Aihe: [mapserver-users] OUTPUTFORMAT png 16-bits

	 

	Hello,

	I'm using Mapserver to output PNG 16-bits DEM raster from .HGT elevation data.

	I'm using the below output format definition :

	OUTPUTFORMAT
	  NAME PNG16
	  DRIVER GDAL/PNG
	  MIMETYPE image/png
	  IMAGEMODE INT16
	  EXTENSION "png"
	END

	However I keep on getting the standard PNG 8-bits out of mapserver.

	 

	The strange thing being that when I use a similar config to get GeoTiff 16-bits, I do get what I'm asking for :

	 

OUTPUTFORMAT
  NAME GEOTIFF16
  DRIVER GDAL/GTiff
  MIMETYPE image/tiff
  IMAGEMODE INT16
  EXTENSION "tiff"
END

	

	 

	
	

	Could that be an issue with the GDAL/PNG driver ? It seems that the GDAL/PNG driver supports only CreateCopy() and not Create(), where the GDAL/GTiff driver supports both ... Could that be it ? I suspect the GDAL/PNG driver so I also sent my issue to the GDAL mailing list.

	 

	I can see from the mailing list that other users already had a similar issue, but there is no obvious reason or solution provided.

	https://lists.osgeo.org/pipermail/mapserver-users/2011-April/068428.html

	https://lists.osgeo.org/pipermail/mapserver-users/2012-January/071310.html

	 

	For information, I'm using GDAL v2.1.3 and Mapserver v7.0.1

	Thanks,

	Johannes

	 



More information about the mapserver-users mailing list