Opened 14 years ago
Closed 14 years ago
#3208 closed defect (fixed)
PNG transparency of color 0 not working
Reported by: | jake | Owned by: | jake |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.0 |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | minor | Keywords: | png transparency nodata |
Cc: |
Description
The NoDataValue is not interpreted as a transparent color value when it is set to 0 in the PNGCreateCopy function. This applies to both gray scale and RGB images but not images with a palette.
If the image is of type RGB and the MetaItem NODATA_VALUES is set to "0 0 0" the transparency value is correctly written to the PNG but not if GDALRasterBand::SetNoDataValue function is used set the nodata value to 0 for the bands. If the image is of gray scale type the NODATA_VALUES is not used at all and GDALRasterBand::SetNoDataValue does not work if the nodata value is 0.
Attachments (1)
Change History (4)
comment:1 by , 14 years ago
Owner: | changed from | to
---|
by , 14 years ago
Attachment: | pngdataset.patch added |
---|
comment:2 by , 14 years ago
Status: | new → assigned |
---|
comment:3 by , 14 years ago
Milestone: | → 1.7.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks. I've applied in r18008 a small variation of your patch where I also test the bHaveNoData flag to avoid writing a transparency value when there is none in the source dataset
Patch for pgndataset.cpp to fix the reported bug