plug-ins: fix #10498 Incorrect layer order when loading certain PSD's

Our handling of Photoshop's Blend Clipped Layers as Group is flawed
causing the order of layers to be messed up which may cause certain
parts of the image to become invisible or having the wrong colors.

This only fixes the incorrect layer ordering. Correct handling of
group layers with clipping needs a more extensive rewrite.
This commit is contained in:
Jacob Boerema 2023-12-26 11:39:36 -05:00
parent 2945fa6db2
commit ec2ee8fe91

View file

@ -1857,7 +1857,15 @@ add_layers (GimpImage *image,
*/
if (lidx > 0)
{
if (gidx == -1)
if (lyr_a[lidx]->group_type != 0)
{
/* Ignoring group layers with clipping set for now. */
IFDBG(3) g_debug ("Group Layer with clipping: [%d] %s",
lidx, lyr_a[lidx]->name);
use_clipping_group = FALSE;
gidx = -1;
}
else if (gidx == -1)
{
use_clipping_group = TRUE;