(imagemagick_compute_animated_image): Respect the GIF disposal methods.

parent b74f0d96
2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
* image.c (imagemagick_compute_animated_image): Respect the GIF
disposal methods.
2013-08-15 Ken Brown <kbrown@cornell.edu>
* emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.
......
......@@ -7887,17 +7887,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
else
composite_wand = animation_cache;
for (i = max (1, animation_index); i <= ino; i++)
for (i = max (1, animation_index + 1); i <= ino; i++)
{
MagickWand *sub_wand;
PixelIterator *source_iterator, *dest_iterator;
PixelWand **source, **dest;
size_t source_width, dest_width;
MagickPixelPacket pixel;
DisposeType dispose;
MagickSetIteratorIndex (super_wand, i);
sub_wand = MagickGetImage (super_wand);
dispose = MagickGetImageDispose (sub_wand);
source_iterator = NewPixelIterator (sub_wand);
if (! source_iterator)
{
......@@ -7925,6 +7928,13 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
ptrdiff_t x;
dest = PixelGetNextIteratorRow (dest_iterator, &dest_width);
for (x = 0; x < source_width; x++)
{
if (dispose == BackgroundDispose)
{
PixelGetMagickColor (source[x], &pixel);
PixelSetMagickColor (dest[x], &pixel);
}
else
{
/* Copy over non-transparent pixels. */
if (PixelGetAlpha (source[x]))
......@@ -7933,6 +7943,7 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
PixelSetMagickColor (dest[x], &pixel);
}
}
}
PixelSyncIterator(dest_iterator);
}
......
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