[gimp] Bug 735904 - Zealous crop of an image with a selection duplicates image data



commit aa0912fcd68239455144cd1455cb883cb78f936f
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 10 00:09:28 2014 +0200

    Bug 735904 - Zealous crop of an image with a selection duplicates image data
    
    Clear the selection before calling gimp_drawable_merge_shadow(), because
    the selection affects the merge, which is unwanted here.

 plug-ins/common/crop-zealous.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/crop-zealous.c b/plug-ins/common/crop-zealous.c
index e996deb..d9c2da4 100644
--- a/plug-ins/common/crop-zealous.c
+++ b/plug-ins/common/crop-zealous.c
@@ -180,6 +180,7 @@ do_zcrop (GimpDrawable *drawable,
   gint8        *killcols;
   gint32        livingrows, livingcols, destrow, destcol;
   gint          total_area, area;
+  gint32        selection_copy;
   gboolean      has_alpha;
 
   width  = drawable->width;
@@ -294,13 +295,21 @@ do_zcrop (GimpDrawable *drawable,
   g_free (killrows);
   g_free (killcols);
 
-  gimp_progress_update (1.00);
+  gimp_drawable_flush (drawable);
 
   gimp_image_undo_group_start (image_id);
 
-  gimp_drawable_flush (drawable);
+  selection_copy = gimp_selection_save (image_id);
+  gimp_selection_none (image_id);
+
   gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
+
+  gimp_image_select_item (image_id, GIMP_CHANNEL_OP_REPLACE, selection_copy);
+  gimp_image_remove_channel (image_id, selection_copy);
+
   gimp_image_crop (image_id, livingcols, livingrows, 0, 0);
 
   gimp_image_undo_group_end (image_id);
+
+  gimp_progress_update (1.00);
 }


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