Skip to content

Commit

Permalink
core: Copy correct filters to new layers
Browse files Browse the repository at this point in the history
Should resolve #11392

In dfb26f3, the NDE filters in the copied image are
retrieved with gimp_image_get_layer_iter (). This works
fine for single layer images or when all the layers are copied
at once. However, if a subset is copied then the filters are always
copied starting from the top level of the image. This can result
in an incorrect filter being copied to the wrong layer.
To fix this, we get the filters from the provided drawables list
instead. This matches the number of layers in the copied
image exactly, since it was used to create the copied image.
  • Loading branch information
cmyk-student committed Apr 26, 2024
1 parent 9f1a099 commit 9a4d365
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/core/gimpimage-new.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ gimp_image_new_from_drawables (Gimp *gimp,
gimp_image_new_copy_drawables (image, drawables, new_image, tag_copies, NULL, NULL, NULL, NULL);

/* Copy any attached layer effects */
old_layers_list = gimp_image_get_layer_iter (image);
old_layers_list = drawables;
for (new_layers_list = gimp_image_get_layer_iter (new_image);
new_layers_list; new_layers_list = g_list_next (new_layers_list))
{
Expand Down

0 comments on commit 9a4d365

Please sign in to comment.