Open yakhawkes opened 12 years ago
I had a look through the source and it looks like the WMSLayer properties are being created correctly as the request to the back end WMS conatins TRANSPARENT=TRUE which means that the canvas object should be of TYPE_INT_ARGB but the saved PNG is only RGB.
I'm having this same issue at the moment. I'm connecting to 2 different WMS servers, and both servers are serving the files as transparent images, but the GWC is serving the tiles from 1 server as non-transparent images. From the other wms-service the gwc-server is serving the images perfectly transparent.
I've done some more research and noticed that the files coming from the WMS-services that will give non-transparent tiles by the GWC are markes as a "8-bit/color RGB" image, where the files from a 'good' wms-service are marked as "8-bit/color RGBA". (@shawkes, I've checked your source too) So it seems that GWC is only checking between RGB and RGBA to see if the file is transparent. It should also support the transparency option in RGB: http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.5.7
Put in other words, stand alone GWC does not seem to support paletted PNG files (8bit) with the alpha channel in the palette entries
Not quite. The transparent PNGs I am having problems with are not paletted (8bit) but full colour (24bit) but instead of having an Alpha channel the PNG format sets a colour has being transparent (e.g. #FFFFFF) in the file header. It seems like when GWC sees there is no Alpha channel in a PNG it assumes that the PNG is not transparent.
On Tue, Aug 21, 2012 at 3:54 PM, shawkes notifications@github.com wrote:
Not quite. The transparent PNGs I am having problems with are not paletted (8bit) but full colour (24bit) but instead of having an Alpha channel the PNG format sets a colour has being transparent (e.g. #FFFFFF) in the file header. It seems like when GWC sees there is no Alpha channel in a PNG it assumes that the PNG is not transparent.
Ah, PNG with a transparent color, but not paletted. First time I hear of such an arrangement, it may be the Java own PNG reader does not support it, in fact a quick search around the web about Java and PNG tranparency only reports cases of usage of the alpha channel or indexed color models
Cheers Andrea
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
Ing. Andrea Aime @geowolf Technical Lead
GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 339 8844549
http://www.geo-solutions.it http://twitter.com/geosolutions_it
I have found that mapXtreme WMS's serve transparent PNGs not in RGBA but in RGB with a bit mask, this is not preserved when the tiles are served from GWS.
In the PNGs from the mapXtreme WMS the tRNS header block is set to #FFFFFF but when the tiles are saved and served from GWC the tRNS header block is missing meaning that the served tiles are opaque with a white background.
Here is the meta tile request to the mapXtreme WMS: http://map.kirklees.gov.uk/WMSTreePreservationOrders/GetMap.ashx?BBOX=408300.0%2C413700.0%2C408600.0%2C414000.0&TRANSPARENT=TRUE&EXCEPTIONS=application%2Fvnd.ogc.se_xml&VERSION=1.1.1&FORMAT=image%2Fpng&SERVICE=WMS&HEIGHT=750&LAYERS=KirkleesTPO&REQUEST=GetMap&STYLES=TPOComboStyle&WIDTH=750&SRS=EPSG%3A27700
and a cached title from that meta tile from GWC: http://osgb.kirklees.gov.uk/geoserver/gwc/service/wms?LAYERS=KirkleesTPO&STYLES=TPOComboStyle&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A27700&BBOX=408400,413900,408500,414000&WIDTH=250&HEIGHT=250