From b800afff008b098cca8b0d25695e9aa3e26fa3c7 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Tue, 12 Apr 2011 19:48:35 +0200 Subject: [PATCH] Fixed thumbnails showed weired colors in clipped areas; see issue #628 --- rtengine/rawimagesource.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 8ce50e682..72f41a692 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1702,8 +1702,13 @@ TMatrix work = iccStore->workingSpaceInverseMatrix (cmp.working); for (int j=0; jwidth; j++) { float newr = mat[0][0]*im->r[i][j] + mat[0][1]*im->g[i][j] + mat[0][2]*im->b[i][j]; + if (newr<0) newr=0; else if (newr>0xffff) newr=0xffff; + float newg = mat[1][0]*im->r[i][j] + mat[1][1]*im->g[i][j] + mat[1][2]*im->b[i][j]; + if (newg<0) newg=0; else if (newg>0xffff) newg=0xffff; + float newb = mat[2][0]*im->r[i][j] + mat[2][1]*im->g[i][j] + mat[2][2]*im->b[i][j]; + if (newb<0) newb=0; else if (newb>0xffff) newb=0xffff; im->r[i][j] = (newr); im->g[i][j] = (newg);