mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
fd8bddae22
commit
29d95f4c39
|
@ -208,10 +208,7 @@ layer_new_from_drawable_invoker (GimpProcedure *procedure,
|
||||||
else
|
else
|
||||||
new_type = GIMP_TYPE_LAYER;
|
new_type = GIMP_TYPE_LAYER;
|
||||||
|
|
||||||
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
|
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
|
||||||
new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
|
|
||||||
else
|
|
||||||
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
|
|
||||||
|
|
||||||
if (new_item)
|
if (new_item)
|
||||||
layer_copy = GIMP_LAYER (new_item);
|
layer_copy = GIMP_LAYER (new_item);
|
||||||
|
|
|
@ -190,10 +190,7 @@ HELP
|
||||||
else
|
else
|
||||||
new_type = GIMP_TYPE_LAYER;
|
new_type = GIMP_TYPE_LAYER;
|
||||||
|
|
||||||
if (dest_image == gimp_item_get_image (GIMP_ITEM (drawable)))
|
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
|
||||||
new_item = gimp_item_duplicate (GIMP_ITEM (drawable), new_type);
|
|
||||||
else
|
|
||||||
new_item = gimp_item_convert (GIMP_ITEM (drawable), dest_image, new_type);
|
|
||||||
|
|
||||||
if (new_item)
|
if (new_item)
|
||||||
layer_copy = GIMP_LAYER (new_item);
|
layer_copy = GIMP_LAYER (new_item);
|
||||||
|
|
Loading…
Reference in New Issue