Incorrect median value in histogram

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The median value in the histogram was not calculated correctly; here is a little patch to correct the error.

diff -ru ../old.gimp-1.2.1/app/gimphistogram.c ./app/gimphistogram.c
--- ../old.gimp-1.2.1/app/gimphistogram.c       Mon Feb  5 20:29:36 2001
+++ ./app/gimphistogram.c       Mon Feb  5 20:30:07 2001
@@ -473,7 +473,7 @@

 for (i = start; i <= end; i++)
   {
-      sum += i * histogram->values[channel][i];
+      sum += histogram->values[channel][i];

     if (sum * 2 > count)
      return i;


Roel Schroeven



[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux