Persistent re-generation of thumbnails for DNG files
Mandatory: Shotwell version the issue was seen with
$ shotwell --version Shotwell 0.28.4
$ exiv2 --version exiv2 0.25 001900 (64 bit build) Copyright (C) 2004-2015 Andreas Huggel.
The expected behaviour
Unsupported EXIF entries do not preclude thumbnailing photos.
What was actually happening
In my library I have a collection of photos that carry Samsung specific EXIF tags, that are not understood by Exiv2.
L 20278 2019-10-11 11:59:06 [DBG] ThumbnailCache.vala:213: import from source: [13451] /home/maciej/media/photos/shotwell/2013/02/16/sg108084.dng
L 20278 2019-10-11 11:59:06 [CRT] Directory Samsung2 with 21313 entries considered invalid; not read.
$ exiv2 /home/maciej/media/photos/shotwell/2013/02/16/sg108084.dng > /dev/null
Error: Directory Samsung2 with 21313 entries considered invalid; not read.
According to exiv2 test cases, such warning does not result in a non-negative return code, just a warning, see example test and implementation:
- https://github.com/Exiv2/exiv2/blob/33c0416bc8bf2c519cf546a457caa8b456c5a533/tests/bugfixes/redmine/test_issue_447.py
- https://github.com/Exiv2/exiv2/blob/1125dcb1e424dab1c9884d4dccdada0385511bb1/src/tiffvisitor_int.cpp
Upon start, Shotwell attempts to read and thumbnail all the files with Samsung metadata from my library (hundreds of GBs). Since the thumbnail process bails out on presence of Exiv2 stderr, the process is repeated every time I start the app. The effect is the startup takes hours, during which Shotwell starves out one core and network IO.
I'd expect Shotwell to do either of two things:
- just generate a thumbnail - the exiv2 warning is incorrectly treated as a critical error. The generic (non-Samsung) metadata can still be read and is accessible to Shotwell, what ought to be sufficient to generate the thumbnail.
- persist information about failure to not attempt to re-thumbnail the image every time. Here, I'd recommend adding a sort of fallback mechanism to accommodate for updates to exiv2 library. I.e. only attempt thumbnail if previous failed attempt used older exiv2 than currently used and / or happened more than some time ago, where "some time" == exponential backoff.
Steps to reproduce the issue
I've attachedsg109158.dng as an example of file with unsupported metadata.