[gimp] Fix a width/height confusion in the healing tool algorithm



commit f7ff0903ff9e87caadd70df6dece0bf2b9d88fdb
Author: Sven Neumann <sven gimp org>
Date:   Fri Oct 16 22:06:34 2009 +0200

    Fix a width/height confusion in the healing tool algorithm
    
    As pointed out by Massimo Valentini in bug #519503, the code used
    height where width should have been used. Correct.

 app/paint/gimpheal.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 5b7021c..fb17af6 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -300,17 +300,18 @@ gimp_heal_laplace_iteration (gdouble *matrix,
                              gdouble *solution,
                              guchar  *mask)
 {
-  gint     rowstride = width * depth;
-  gint     i, j, k;
-  gdouble  tmp, diff;
-  gdouble  err       = 0.0;
+  const gint  rowstride = width * depth;
+  gint        i, j, k;
+  gdouble     tmp, diff;
+  gdouble     err       = 0.0;
 
   for (i = 0; i < height; i++)
     {
       for (j = 0; j < width; j++)
         {
-          if ((0 == *mask) || (i == 0) || (i == (height - 1)) ||
-              (j == 0) || (j == (height - 1)))
+          if ((0 == *mask) ||
+              (i == 0) || (i == (height - 1)) ||
+              (j == 0) || (j == (width - 1)))
             {
               /* do nothing at the boundary or outside mask */
               for (k = 0; k < depth; k++)



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