Ticket #1173 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

[PATCH] gdal_translate: tiff tags discarded with -co profile=Geotiff or Baseline

Reported by: quickstuff@… Owned by: warmerdam
Priority: normal Milestone: 1.6.0
Component: GDAL_Raster Version: unspecified
Severity: minor Keywords: GeoTIFF
Cc: mloskot, rouault

Description (last modified by mloskot) (diff)

While converting tiff to tiff with gdal_translate, the creation options PROFILE=GeoTIFF and PROFILE=BASELINE discard many existing tifftags and/or prevent the addition of new ones.

It seems to affect baseline (informative, non-critical tags such as Resolutionunit, Imagedescription etc.

Other baseline tags are unsupported whatever profile is invoked ; e.g. Artist or Copyright

Attachments

gdal_svn_geotiff_fix_1527_and_1173.patch Download (5.2 KB) - added by rouault 6 years ago.

Change History

Changed 7 years ago by quickstuff@…

Guess it is related to the lines :
    if( EQUAL(pszProfile,"GDALGeoTIFF") )
        GTiffDataset::WriteMetadata( poSrcDS, hTIFF, FALSE );
in geotiff.cpp

Changed 6 years ago by warmerdam

  • cc warmerdam added
  • owner changed from warmerdam to mloskot
  • description modified (diff)
  • milestone set to 1.5.0

Mateusz,

I'd appreciate your looking into this. I think we need to call WriteMetadata?() regardless of profile, but within WriteMetadata?() we need to avoid writing custom TIFF metadata tags unless we are in the default GDALGeoTIFF profile.

Lets just do this in trunk since changes are fairly high risk, and need is modest. There should be a test suite test of some sort added to check profile operation in this regard, and perhaps some others.

Changed 6 years ago by rouault

This is closely related to #1527.

I'm attaching a patch that should fix both issues.

Changed 6 years ago by rouault

Changed 6 years ago by rouault

  • summary changed from gdal_translate: tiff tags discarded with -co profile=Geotiff or Baseline to [PATCH] gdal_translate: tiff tags discarded with -co profile=Geotiff or Baseline

Changed 6 years ago by mloskot

  • keywords GeoTIFF added
  • description modified (diff)

Changed 6 years ago by mloskot

  • cc mloskot added
  • owner changed from mloskot to rouault

Changed 6 years ago by warmerdam

  • cc rouault added; warmerdam removed
  • owner changed from rouault to warmerdam

I'll review the patch. I'm a bit nervous about this area.

Changed 5 years ago by warmerdam

  • milestone changed from 1.5.0 to 1.6.0

Changed 5 years ago by warmerdam

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

See #1527 for details, fixed in trunk (r14033) with tests (r14032).

Note: See TracTickets for help on using tickets.