[gdal-dev] Outdated external overviews

Julien Michel julien.michel at cnes.fr
Fri Oct 7 06:34:57 PDT 2016


Dear all,

I recently came accross an issue in our software which uses overviews to 
speed-up navigation in image : the image can change after an external 
overview has been generated (for instance it has been re-generated by an 
upstream processing chain with different parameters), this can lead to 
display bugs or even crash in client code (if for instance the number of 
bands has changed). Of course this is not a problem for the user that 
knows what she is doing : simply removing and generating the overview 
again fixes the problem. But for software that offers overview 
generation to the end user, this might become an issue, as the software 
has no clue wether the ovr file is outdated or not.

Possible mecanism to prevent this would be :

- Check file last modification time between external overview and image 
file. If image file is newer than overview files, it is probably outdated.

- Encode image checksum in ovr file, and compare it upon loading (might 
be a bit intensive).

With those checks, gdal could detect that the ovr file is outdated and 
simply ignore it. Then client code could be aware that there are 
actually no overviews for this image and take actions to generate new ones.

Any thought ?

Regards,

Julien

PS: This of course does not apply if overviews are internal

-- 
Julien MICHEL
CNES - DCT/SI/AP



More information about the gdal-dev mailing list