Commit e8f6a388 authored by Ell's avatar Ell

plug-ins: in file-psd, read blend mode info of lsct layer records

The section-divider (lsct) layer resource may contain blend mode
information, which apparently overrides the blend mode specified in
the layer record.  When reading such a resource, replace the layer's
blend mode with the one specified by the resource.

It seems like pass-through group layers specify normal mode in their
layer record, but pass-through in their section-divider resource, so
this commit allows correctly loading such layers.
parent ff299209
......@@ -551,6 +551,31 @@ load_resource_lsct (const PSDlayerres *res_a,
IFDBG(3) g_debug ("Section divider type: %i", type);
lyr_a->group_type = type;
if (res_a->data_len >= 12)
gchar signature[4];
gchar blend_mode[4];
if (fread (signature, 4, 1, f) < 1 ||
fread (blend_mode, 4, 1, f) < 1)
psd_set_error (feof (f), errno, error);
return -1;
if (memcmp (signature, "8BIM", 4) == 0)
memcpy (lyr_a->blend_mode, blend_mode, 4);
IFDBG(2) g_debug ("Section divider layer mode sig: %.4s, blend mode: %.4s",
signature, blend_mode);
IFDBG(1) g_debug ("Incorrect layer mode signature %.4s", signature);
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment