From c55f4e65e25acc3dc70889fb922421aa2634f9e7 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Tue, 2 Oct 2012 20:24:29 +0200 Subject: [PATCH] Fixed auto-exposure on image with large overexposed areas on behalf of Victor, see issue 1358 --- rtengine/improcfun.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 52d757560..3cbe76f39 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -1196,7 +1196,7 @@ fclose(f);*/ //find average luminance for (int i=0; ilog(imax+1)/log2(2)) { octile[7]=1.5*octile[6]-0.5*octile[5]; } + for(int i=1; i<8; i++) { + if (octile[i] == 0.0) + octile[i] = octile[i-1]; + } // compute weighted average separation of octiles // for future use in contrast setting for (int i=1; i<6; i++) {