Opened 18 years ago

Last modified 18 years ago

#1355 closed defect (fixed)

can't add alpha layer to grayscale TIFF

Reported by: schuyler@… Owned by: warmerdam
Priority: highest Milestone:
Component: GDAL_Raster Version: 1.3.2
Severity: blocker Keywords:
Cc:

Description

Using "gdalwarp -dstalpha" to add an alpha layer to a grayscale TIFF results in:

  ERROR 6: SetColorInterpretation() not supported for this dataset.

The resulting image has two bands, one ColorInterp=Gray and one ColorInterp=Unknown. The image borders do not subsequently appear transparent when rendered in MapServer (as they do when ColorInterp=Alpha).

Change History (1)

comment:1 by warmerdam, 18 years ago

Modified gdal/frmts/gtiff/geotiff.cpp to implement a very limited 
SetColorInterpretation() on the GTiffRasterBand that will allow
setting of the 2nd band (for greyscale) or 4th band (for rgb) as
alpha in situations it wouldn't otherwise be treated that way.

This fixes this particular bug, but it isn't a very general solution.
Note: See TracTickets for help on using tickets.