summaryrefslogtreecommitdiff
path: root/libopie2/opieui/oimageeffect.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/oimageeffect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oimageeffect.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp
index be47eb2..93719bc 100644
--- a/libopie2/opieui/oimageeffect.cpp
+++ b/libopie2/opieui/oimageeffect.cpp
@@ -2048,14 +2048,17 @@ void OImageEffect::normalize(QImage &img)
2048 for(high=MaxRGB; high != 0; --high) 2048 for(high=MaxRGB; high != 0; --high)
2049 { 2049 {
2050 intense+=histogram[high]; 2050 intense+=histogram[high];
2051 if(intense > threshold_intensity) 2051 if(intense > threshold_intensity)
2052 break; 2052 break;
2053 } 2053 }
2054 if(low == high) 2054 if(low == high) {
2055 free(histogram);
2056 free(normalize_map);
2055 return; // zero span bound 2057 return; // zero span bound
2058 }
2056 } 2059 }
2057 2060
2058 // Stretch the histogram to create the normalized image mapping. 2061 // Stretch the histogram to create the normalized image mapping.
2059 for(i=0; i <= MaxRGB; i++){ 2062 for(i=0; i <= MaxRGB; i++){
2060 if (i < (int) low) 2063 if (i < (int) low)
2061 normalize_map[i]=0; 2064 normalize_map[i]=0;