From 65a14051feea1497fd39f38d24637761dc989f8c Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 18 Jan 2024 14:19:30 +0100 Subject: [PATCH] rawimage: put global black level (as found in DNG converted files) for xtrans files where the code expects to find it --- rtengine/rawimage.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 704db176f..301107034 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -606,6 +606,11 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog for (size_t i = 0; i < sizeof(cblack)/sizeof(unsigned); ++i) { cblack[i] = cd.cblack[i]; } + // put the global black level where the rest of the code expects to find it + if (dng_version && isXtrans() && cblack[6] == 0 && black > 0) { + cblack[6] = black; + } + for (int i = 0; i < 4; ++i) { cam_mul[i] = cd.cam_mul[i]; pre_mul[i] = cd.pre_mul[i];