From ab44f5af0a190833f960701e9b003a582dd5902d Mon Sep 17 00:00:00 2001 From: Victor Forsiuk Date: Wed, 12 Mar 2025 19:50:37 +0200 Subject: [PATCH] Fix interpreting TIFF images as LDR/HDR LDR/HDR is not determined by the sample format (floating point or integer), but by the bit depth. Actually, we use this flag to determine whether image data in the absence of color space metadata should be treated as linear or nonlinear. --- src/imageio/imageio_tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imageio/imageio_tiff.c b/src/imageio/imageio_tiff.c index 0fb60dc5e003..701708ed59cb 100644 --- a/src/imageio/imageio_tiff.c +++ b/src/imageio/imageio_tiff.c @@ -451,8 +451,8 @@ dt_imageio_retval_t dt_imageio_open_tiff(dt_image_t *img, const char *filename, return DT_IMAGEIO_CACHE_FULL; } - // flag the image buffer properly depending on sample format - if(t.sampleformat == SAMPLEFORMAT_IEEEFP) + // Flag the image properly depending on bit depth + if(t.bpp > 8) { // HDR TIFF t.image->flags &= ~DT_IMAGE_LDR;