From 8ba90206ef111b91af32ae93fad31563d49be755 Mon Sep 17 00:00:00 2001 From: Andrii Ryzhkov Date: Mon, 4 May 2026 22:04:21 +0200 Subject: [PATCH] Add TIFFTAG_PREVIEWCOLORSPACE fallback for libtiff < 4.6 --- src/imageio/imageio_dng.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/imageio/imageio_dng.c b/src/imageio/imageio_dng.c index 4ba764a8e4bf..5da1fa350213 100644 --- a/src/imageio/imageio_dng.c +++ b/src/imageio/imageio_dng.c @@ -36,6 +36,11 @@ #include #endif +// fallback for libtiff < 4.6 +#ifndef TIFFTAG_PREVIEWCOLORSPACE +#define TIFFTAG_PREVIEWCOLORSPACE 50970 +#endif + // DNG uses SRATIONAL / RATIONAL for matrix and WB tags. libtiff accepts // these as float/double arrays and handles the conversion; we just pass // the values as double