plug-ins: fix using wrong offset for group layer masks in psd export.

Exporting to psd could result in very large files which often failed to
load in both GIMP and PS when a group layer with a layer mask
was present.

Reported on our IRC channel with a sample xcf which made it
possible to figure out the problem.
This commit is contained in:
Jacob Boerema 2021-05-04 15:48:34 -04:00
parent fca3f23c60
commit 8fdeaddbe7
1 changed files with 3 additions and 1 deletions

View File

@ -1538,7 +1538,9 @@ write_pixel_data (FILE *fd,
if (ChanLenPosition) /* Update total compressed length */
{
fseek (fd, ChanLenPosition[bytes], SEEK_SET); /*+bytes OR SOMETHING*/
/* Mask follows other components so use that as offset. */
fseek (fd, ChanLenPosition[components], SEEK_SET);
write_gint32 (fd, len, "channel data length");
IFDBG printf ("\t\tUpdating data len to %d, at %ld\n", len, ftell(fd));
}