Commit 8b296873 authored by Alexis Wilhelm's avatar Alexis Wilhelm Committed by Michael Schumacher

Bug 637413 - Saving indexed png with transparency removes one unused color from the colormap

parent 1e99b12a
......@@ -2168,15 +2168,9 @@ find_unused_ia_color (GeglBuffer *buffer,
if (trans_used == FALSE)
return -1;
for (i = 0; i < *colors; i++)
{
if (ix_used[i] == FALSE)
return i;
}
/* Couldn't find an unused color index within the number of
bits per pixel we wanted. Will have to increment the number
of colors in the image and assign a transparent pixel there. */
/* If there is still some room at the end of the palette, increment
* the number of colors in the image and assign a transparent pixel
* there. */
if ((*colors) < 256)
{
(*colors)++;
......@@ -2184,6 +2178,12 @@ find_unused_ia_color (GeglBuffer *buffer,
return (*colors) - 1;
}
for (i = 0; i < *colors; i++)
{
if (ix_used[i] == FALSE)
return i;
}
return -1;
}
......
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