[mapserver-users] Quantize and 8bit/1bit PNG problem

Frank Warmerdam warmerdam at pobox.com
Mon Nov 2 09:59:13 EST 2009


paalkr wrote:
> Hi!
> 
> Could I please ask for a comment on this issue from one of the developers?

Pål,

One bit PNGs are a perfectly valid response.   I would suggest
two approaches.

1) File a ticket with Microsoft on Bing Maps, and hopefully they will
roll a fix into their operational build within a couple days.  (ha ha)

2) Manually produce a nice empty tile that works with Bing Maps some
other way, and write a script to replace the 1bit PNG file (which should
presumably have a fixed size) with the bing-safe ones.

Perhaps not the sort of answer you were hoping for, but you did
implore us for comment even when none of us thought we had anything
particularly bright to say.

Best regards,

> paalkr wrote:
>> Hi!
>>
>> I have the following output format defined in my mapfile (MapServer
>> 5.4.2):
>>
>>    OUTPUTFORMAT
>>       NAME "png8bit"
>>       DRIVER "AGG/PNG"
>>       MIMETYPE "image/png"
>>       EXTENSION "png"
>>       FORMATOPTION "QUANTIZE_FORCE=ON"
>>       FORMATOPTION "QUANTIZE_COLORS=256"
>>       FORMATOPTION "QUANTIZE_NEW=ON"
>>       FORMATOPTION INTERLACE=OFF
>>    END
>>
>> This works very well most of the time, even transparency. But in
>> situations where the GetMap request don't contain any data at all
>> (returned image should be total transparent) the resulting PNG is 1bit in
>> stead of 8bits. If the produced image does contain some data the produced
>> image i 8bits, with correctly rendered transparency where there are no
>> data.
>>
>> This behavior are specially troublesome when building a tile cache because
>> there are a lot of this request without any valid data. In almost all
>> applications I guess that this issue wouldn't do any harm, but we uses
>> Bing Maps for some projects and Bing Maps can't handle 1bit PNGs.
>>
>> What can be done to overcome this issue? 


-- 
---------------------------------------+--------------------------------------
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