[gimp] Bug 586591 - Opening jpg image sets cpu activity to 100%



commit 9b1681216d018f9b30500a82a6a24b1f0306a3f2
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jun 22 20:24:28 2009 +0200

    Bug 586591 - Opening jpg image sets cpu activity to 100%
    
    (gimp_projection_validate_tile): fix stupid braino that made the
    recently added optimization loop infinitely on images with a width
    that is a multiple of TILE_WIDTH.

 app/core/gimpprojection.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 3b761b8..d4cfa63 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -776,23 +776,22 @@ gimp_projection_validate_tile (TileManager    *tm,
        */
       t = tile_manager_get_at (tm, col, row, FALSE, FALSE);
 
-      if (t)
-        {
-          if (tile_is_valid (t))
-            break;
+      /*  if we hit the right border, or a valid tile, bail out
+       */
+      if (! t || tile_is_valid (t))
+        break;
 
-          /*  HACK: mark the tile as valid, so locking it with r/w access
-           *  won't validate it
-           */
-          t->valid = TRUE;
-          t = tile_manager_get_at (tm, col, row, TRUE, TRUE);
+      /*  HACK: mark the tile as valid, so locking it with r/w access
+       *  won't validate it
+       */
+      t->valid = TRUE;
+      t = tile_manager_get_at (tm, col, row, TRUE, TRUE);
 
-          /*  add the tile's width to the chunk to validate  */
-          tile_width = tile_ewidth (t);
-          width += tile_width;
+      /*  add the tile's width to the chunk to validate  */
+      tile_width = tile_ewidth (t);
+      width += tile_width;
 
-          additional[n_additional++] = t;
-        }
+      additional[n_additional++] = t;
     }
 
   gimp_projection_construct (proj, x, y, width, height);



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