plug-ins: in file-psd, use normal channel order

For some reason we reverse the channel order when loading/saving a
PSD file.  This doesn't seem to be necessary, and leads to a
reversed channel order across GIMP/Photoshop.  Simply use the
normal channel order instead.
This commit is contained in:
Ell 2020-04-26 23:31:50 +03:00
parent 281188e169
commit 2d4de85fe3
2 changed files with 4 additions and 4 deletions

View File

@ -2098,7 +2098,7 @@ add_merged_image (GimpImage *image,
channel = gimp_channel_new (image, alpha_name,
chn_a[cidx].columns, chn_a[cidx].rows,
alpha_opacity, &alpha_rgb);
gimp_image_insert_channel (image, channel, NULL, 0);
gimp_image_insert_channel (image, channel, NULL, i);
g_free (alpha_name);
buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (channel));
if (alpha_id)

View File

@ -680,7 +680,7 @@ save_resources (FILE *fd,
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (PSDImageData.merged_layer)))
write_string (fd, "Transparency", "channel name");
for (iter = g_list_last (PSDImageData.lChannels); iter; iter = iter->prev)
for (iter = PSDImageData.lChannels; iter; iter = g_list_next (iter))
{
char *chName = gimp_item_get_name (iter->data);
write_string (fd, chName, "channel name");
@ -743,7 +743,7 @@ save_resources (FILE *fd,
write_gchar (fd, 1, "channel mode");
}
for (iter = g_list_last (PSDImageData.lChannels); iter; iter = iter->prev)
for (iter = PSDImageData.lChannels; iter; iter = g_list_next (iter))
{
GimpChannel *channel = iter->data;
GimpRGB color;
@ -1583,7 +1583,7 @@ save_data (FILE *fd,
chan = nChansLayer (PSDImageData.baseType,
gimp_drawable_has_alpha (GIMP_DRAWABLE (PSDImageData.merged_layer)), 0);
for (iter = g_list_last (PSDImageData.lChannels), i = PSDImageData.nChannels - 1; iter; iter = iter->prev, i--)
for (iter = PSDImageData.lChannels; iter; iter = g_list_next (iter))
{
IFDBG printf ("\t\tWriting compressed channel data for channel %d\n",
i);