From 14e3f0e88d34067aad67416b4aacc926b3d680ad Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 5 May 2017 21:29:58 +0200 Subject: [PATCH] Auto Levels completely wrong for monochrome raw files, sigma raw files and canon mraw/sraw files. Fixes #3863 --- rtengine/rawimagesource.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index e178906d4..f54d744c4 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -4613,13 +4613,13 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) } } else if (ri->get_colors() == 1) { for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb_red * rawData[i][j])]++; + tmphistogram[(int)(refwb[0] * rawData[i][j])]++; } } else { for (int j = start; j < end; j++) { - tmphistogram[CLIP((int)(refwb_red * rawData[i][3 * j + 0]))]++; - tmphistogram[CLIP((int)(refwb_green * rawData[i][3 * j + 1]))] += 2; - tmphistogram[CLIP((int)(refwb_blue * rawData[i][3 * j + 2]))]++; + tmphistogram[(int)(refwb[0] * rawData[i][3 * j + 0])]++; + tmphistogram[(int)(refwb[1] * rawData[i][3 * j + 1])]++; + tmphistogram[(int)(refwb[2] * rawData[i][3 * j + 2])]++; } } }