Opened 18 years ago

Closed 16 years ago

#1173 closed defect (fixed)

[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: Mateusz Łoskot, Even Rouault

Description (last modified by Mateusz Łoskot)

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 (1)

gdal_svn_geotiff_fix_1527_and_1173.patch (5.2 KB ) - added by Even Rouault 17 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by quickstuff@…, 18 years ago

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

comment:2 by warmerdam, 17 years ago

Cc: warmerdam added
Description: modified (diff)
Milestone: 1.5.0
Owner: changed from warmerdam to Mateusz Łoskot

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.

comment:3 by Even Rouault, 17 years ago

This is closely related to #1527.

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

by Even Rouault, 17 years ago

comment:4 by Even Rouault, 17 years ago

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

comment:5 by Mateusz Łoskot, 17 years ago

Description: modified (diff)
Keywords: GeoTIFF added

comment:6 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Owner: changed from Mateusz Łoskot to Even Rouault

comment:7 by warmerdam, 16 years ago

Cc: Even Rouault added; warmerdam removed
Owner: changed from Even Rouault to warmerdam

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

comment:8 by warmerdam, 16 years ago

Milestone: 1.5.01.6.0

comment:9 by warmerdam, 16 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.