(Backport) Issue #8127: Option to load reduced TIFFs
This patch attempts to resolve the issue noted in issue #8127 (closed) on the stable branch. Currently, GIMP assumes that if a page/layer has the metadata FILETYPE_REDUCEDIMAGE set, it must be a thumbnail. However, this is not always the case.
This code lets uses conditionally display layers/pages with that metadata set on load, provided there is more than one layer/page with FILETYPE_REDUCEDIMAGE set (per @Wormnest, in this scenario it is likely to be a thumbnail).
To achieve this, a new enum TIFF_THUMBNAIL_TYPE
was added to distinguish between FILETYPE_REDUCEDIMAGE layers/pages and the other possible thumbnail types. A new variable n_reducedimage_pages
was also added to the TiffSelectedPages
struct to count how FILETYPE_REDUCEDIMAGE layers/pages there are. Based on the toggle, that value or the existing n_filtered_pages
count are used to determine how many pages to display.
A sample image can be found at https://openslide.cs.cmu.edu/download/openslide-testdata/Generic-TIFF/. On 2.10.30, only one page is displayed on load. With this patch, 9 pages of various reduced resolutions can optionally be loaded.
If approved, this should be fairly easy to port to 2.99.