Ticket #1550 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Problem in gdal_translate and -co "PHOTOMETRIC=MINISBLACK"

Reported by: 1980 Owned by: warmerdam
Priority: normal Milestone: 1.4.1
Component: GDAL_Raster Version: 1.4.0
Severity: normal Keywords:
Cc:

Description (last modified by warmerdam) (diff)

I have a problem which relates to the gdal_translate and -co "PHOTOMETRIC=MINISBLACK" option.

I'm trying to do mosaic with gdalwarp and I'm using 4 band 8 byte Geotiff aerial images. Gdalwarp use the last band as Alpha so the mosaic image is not correct.

Therefore I have to change the last band something different than the alpha. If I'm understand right the gdal_translate -co "PHOTOMETRIC=MINISBLACK" should change the band ColorInterpretation? from alpha to something else.

So here are my commands:

G:\Gdal_bug>gdal_translate -of Gtiff -co "PHOTOMETRIC=MINISBLACK" 1076.tif aerial_image.tif
Input file size is 400, 200
0...10...20...30...40...50...60...70...80...90...100 - done.

G:\Gdal_bug>gdalinfo aerial_image.tif
Driver: GTiff/GeoTIFF
Size is 400, 200
Coordinate System is `'
Origin = (310100.000000000000000,6961000.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Corner Coordinates:
Upper Left  (  310100.000, 6961000.000)
Lower Left  (  310100.000, 6960900.000)
Upper Right (  310300.000, 6961000.000)
Lower Right (  310300.000, 6960900.000)
Center      (  310200.000, 6960950.000)
Band 1 Block=400x20 Type=Byte, ColorInterp=Red
Band 2 Block=400x20 Type=Byte, ColorInterp=Green
Band 3 Block=400x20 Type=Byte, ColorInterp=Blue
Band 4 Block=400x20 Type=Byte, ColorInterp=Alpha

Program version is FWTOOLS 1.1.4

Attachments

1076.tif Download (313.1 KB) - added by 1980 6 years ago.
source file in gdal_translate
aerial_image.tif Download (313.1 KB) - added by 1980 6 years ago.
destination file in gdal_translate

Change History

Changed 6 years ago by 1980

source file in gdal_translate

Changed 6 years ago by 1980

destination file in gdal_translate

Changed 6 years ago by warmerdam

  • owner changed from Frank Warmerdam to warmerdam
  • description modified (diff)
  • milestone set to 1.4.1

Changed 6 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

I have reproduced the problem and established that it is due to flawed logic in the CreateCopy?() method. I have corrected this in trunk and 1.4 branch.

Note: See TracTickets for help on using tickets.