Opened 16 years ago
Closed 14 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.
Note:
See TracTickets
for help on using tickets.
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.