[gimp] pdb: fix gimp_layer_new_from_drawable() PDB wrapper



commit 29d95f4c39463ba644a7a4795c352b06fde529cb
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 19 21:39:13 2013 +0100

    pdb: fix gimp_layer_new_from_drawable() PDB wrapper
    
    We must always call gimp_item_convert() even if the source drawable is
    in the same image, or we might end up with a layer of wrong pixel
    format. This was probably broken for years.

 app/pdb/layer-cmds.c       |    5 +----
 tools/pdbgen/pdb/layer.pdb |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/app/pdb/layer-cmds.c b/app/pdb/layer-cmds.c
index da8dcaf..0917bdd 100644
--- a/app/pdb/layer-cmds.c
+++ b/app/pdb/layer-cmds.c
@@ -208,10 +208,7 @@ layer_new_from_drawable_invoker (GimpProcedure         *procedure,
       else
         new_type = GIMP_TYPE_LAYER;
 
-      if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
-        new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
-      else
-        new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
+      new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
 
       if (new_item)
         layer_copy = GIMP_LAYER (new_item);
diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb
index 415f23c..53a2ca7 100644
--- a/tools/pdbgen/pdb/layer.pdb
+++ b/tools/pdbgen/pdb/layer.pdb
@@ -190,10 +190,7 @@ HELP
   else
     new_type = GIMP_TYPE_LAYER;
 
-  if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
-    new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
-  else
-    new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
+  new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
 
   if (new_item)
     layer_copy = GIMP_LAYER (new_item);


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