Ticket #1550 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Problem in gdal_translate and -co "PHOTOMETRIC=MINISBLACK"

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

Description (Last modified by warmerdam)

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 (313.1 kB) - added by 1980 on 04/02/07 04:47:30.
source file in gdal_translate
aerial_image.tif (313.1 kB) - added by 1980 on 04/02/07 04:48:39.
destination file in gdal_translate

Change History

04/02/07 04:47:30 changed by 1980

  • attachment 1076.tif added.

source file in gdal_translate

04/02/07 04:48:39 changed by 1980

  • attachment aerial_image.tif added.

destination file in gdal_translate

04/02/07 19:03:09 changed by warmerdam

  • owner changed from Frank Warmerdam to warmerdam.
  • description changed.
  • milestone set to 1.4.1.

04/02/07 19:27:55 changed 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.