Opened 16 years ago

Closed 15 years ago

#2431 closed defect (duplicate)

geotiff driver not saving stats to .aux.xml

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: 1.5.2
Severity: normal Keywords: PAM GTiff
Cc: gaopeng

Description

The command:

gdalinfo -stats utm.tif

does not store the stats in internal metadata or an .aux.xml file as expected. This appears to be due to gdalinfo opening the file read-only, and this code in geotiff.cpp:

    if( GetAccess() == GA_Update && bBase )
    {
        if( bNewDataset || bMetadataChanged )
            WriteMetadata( this, hTIFF, TRUE );

On the other hand, requesting stats on most other formats, such as png, will result in an .aux.xml file being written even though the underlying file was opened in read-only mode.

Change History (2)

comment:1 by Even Rouault, 16 years ago

I'm realizing I had proposed a patch about the very same subject in #2156. But I doubt it would apply on current trunk, and that it was completely correct.

comment:2 by Even Rouault, 15 years ago

Resolution: duplicate
Status: newclosed

Fixed by #2156

Note: See TracTickets for help on using tickets.