Open postscript-dev opened 2 years ago
This matter is discussed in my book: https://clanmills.com/exiv2/book/#5. The code to deal with this for JPEG and CR3 files is in tvisitor.cpp
Additionally, I have been working with David to extract format specific thumbnails from CR3 files: https://github.com/Exiv2/exiv2/issues/1893#issuecomment-934381773
@postscript-dev It could be most helpful if you could "scope" this issue as I am sure there are other formats (PNG, TIFF and others) which have multiple thumbnails which are not reported by Exiv2. The way to "scope" this issue is to use the ExifTool's test image repository and compare the thumbnail extraction of ExifTool and Exiv2.
I believe the code to modify/replace/delete thumbnails is weak. In the first instance, finding and extracting thumbnails is a precursor to a future project about editing thumbnails.
At the moment, I don't have time to widen the scope. I will try and look at this again at some point.
Thanks for logging this issue, Peter. The Exiv2 preview code was added more than 10 years ago and you're the first person to open an issue about this. The number of folks contributing to Exiv2 is steadily increasing. One day this will get attention.
Is your feature request related to a problem? Please describe. In addition to a file's main image, the metadata can contain several other smaller versions of that image (see PREVIEW IMAGES AND THUMBNAILS in the manpage). Exiv2 does not extract all of the available previews in an image.
For example, in PREVIEW IMAGES AND THUMBNAILS, the Stonehenge.jpg file is listed as only containing 1 preview which is the thumbnail:
When using ExifTool though, there are 3 previews available:
The 3 images can be found in Stonehenge_previews_using_ExifTool.zip.
Describe the solution you'd like Stonehenge.jpg is used in the manpage as a sample file. Adding the missing previews, would demonstrate how the feature works, helping others to understand the mechanism.
Additional context There is a discussion in #1893 about adding preview images to files.