From 83bc6140bdaf19d73ecdd7539cfa76bd15d50e2a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 25 Jan 2018 21:27:10 +0100 Subject: [PATCH] Avoid Lab L values which lead to negative Y values when converting Lab to XYZ, fixes #4334 --- rtengine/iplocalcontrast.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/iplocalcontrast.cc b/rtengine/iplocalcontrast.cc index 24739fb6b..aa1eeff7d 100644 --- a/rtengine/iplocalcontrast.cc +++ b/rtengine/iplocalcontrast.cc @@ -62,7 +62,7 @@ void ImProcFunctions::localContrast(LabImage *lab) bufval *= (bufval > 0.f) ? light : dark; } - lab->L[y][x] += bufval; + lab->L[y][x] = std::max(0.0001f, lab->L[y][x] + bufval); } } }