[gimp/gimp-2-8] pdb: fix gimp_layer_new_from_drawable() PDB wrapper
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] pdb: fix gimp_layer_new_from_drawable() PDB wrapper
- Date: Tue, 19 Nov 2013 20:43:07 +0000 (UTC)
commit 97dcb9dc088883afaeaf3425ffd2ecfa3928850b
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.
(cherry picked from commit 29d95f4c39463ba644a7a4795c352b06fde529cb)
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 4cc2556..502642b 100644
--- a/app/pdb/layer-cmds.c
+++ b/app/pdb/layer-cmds.c
@@ -159,10 +159,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 a463017..66cf609 100644
--- a/tools/pdbgen/pdb/layer.pdb
+++ b/tools/pdbgen/pdb/layer.pdb
@@ -145,10 +145,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]