[gimp/metadata-browser] app: enable GEGL scaling of indexed drawables in gimp_drawable_scale()



commit 248ba19ca33aaf832ece81baeb4d95a19bc352bb
Author: Michael Natterer <mitch gimp org>
Date:   Sun Mar 18 16:33:22 2012 +0100

    app: enable GEGL scaling of indexed drawables in gimp_drawable_scale()
    
    by simply using gimp_drawable_apply_operation_to_buffer() and the
    right Babl format on the buffer.

 app/core/gimpdrawable.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 7ccc715..e890c82 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -474,10 +474,10 @@ gimp_drawable_scale (GimpItem              *item,
 #endif
 
   if (gimp_use_gegl (gimp_item_get_image (item)->gimp) &&
-      ! gimp_drawable_is_indexed (drawable)            &&
       interpolation_type != GIMP_INTERPOLATION_LANCZOS)
     {
-      GeglNode *scale;
+      GeglNode   *scale;
+      GeglBuffer *buffer;
 
       scale = g_object_new (GEGL_TYPE_NODE,
                             "operation", "gegl:scale",
@@ -494,10 +494,15 @@ gimp_drawable_scale (GimpItem              *item,
                                     gimp_item_get_height (item)),
                      NULL);
 
-      gimp_drawable_apply_operation_to_tiles (drawable, progress,
-                                              C_("undo-type", "Scale"),
-                                              scale, TRUE, new_tiles);
+      buffer = gimp_tile_manager_create_buffer (new_tiles,
+                                                gimp_drawable_get_format (drawable),
+                                                TRUE);
+
+      gimp_drawable_apply_operation_to_buffer (drawable, progress,
+                                               C_("undo-type", "Scale"),
+                                               scale, TRUE, buffer);
       g_object_unref (scale);
+      g_object_unref (buffer);
     }
   else
     {



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