Opened 8 years ago

Closed 8 years ago

#6102 closed defect (fixed)

gdalwarp -dstalpha doesn't tag the last channel as alpha

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 2.1.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: tiff alpha gdalwarp
Cc: warmerdam


If doing "gdalwarp in.tif out.tif -dstalpha" where in.tif has 4 or more bands, out.tif will not have its last added channel tagged as being alpha in the TIFF file. It will be only written in the .aux.xml file.

Furthermore, if adding -co ALPHA=YES, the second band will be tagged (in the TIFF) as alpha. But this latter behaviour is consistant with the documentation of the ALPHA creatoin option : "The first "extrasample" is marked as being alpha if there are any extra samples"

Change History (2)

comment:1 by Even Rouault, 8 years ago

trunk r30218 "GTiff: make SetColorInterpretation(GCI_AlphaBand) work on a 5 band or more GeoTIFF (#6102)"

This commit only warns if -co ALPHA=YES is used : "Warning 1: Band 2 was already identified as alpha band, and band 6 is now marked as alpha too. Presumably ALPHA creation option is not needed". I'm not sure about the reason for why the 1st extrasample was selected and not the latest, and didn't want to change that semantics. Although we could probably have a new semantic like "The first "extrasample" is marked by default as being alpha if there are any extra samples. The choice of the first extrasample can be modified by calling SetColorInterpretation(GCI_AlphaBand) on another extra sample band."

comment:2 by Even Rouault, 8 years ago

Milestone: 2.1.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.