(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> 2013-08-15 Ken Brown <kbrown@cornell.edu>
* emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC. * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.
......
...@@ -7887,17 +7887,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino) ...@@ -7887,17 +7887,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
else else
composite_wand = animation_cache; 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; MagickWand *sub_wand;
PixelIterator *source_iterator, *dest_iterator; PixelIterator *source_iterator, *dest_iterator;
PixelWand **source, **dest; PixelWand **source, **dest;
size_t source_width, dest_width; size_t source_width, dest_width;
MagickPixelPacket pixel; MagickPixelPacket pixel;
DisposeType dispose;
MagickSetIteratorIndex (super_wand, i); MagickSetIteratorIndex (super_wand, i);
sub_wand = MagickGetImage (super_wand); sub_wand = MagickGetImage (super_wand);
dispose = MagickGetImageDispose (sub_wand);
source_iterator = NewPixelIterator (sub_wand); source_iterator = NewPixelIterator (sub_wand);
if (! source_iterator) if (! source_iterator)
{ {
...@@ -7926,12 +7929,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino) ...@@ -7926,12 +7929,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
dest = PixelGetNextIteratorRow (dest_iterator, &dest_width); dest = PixelGetNextIteratorRow (dest_iterator, &dest_width);
for (x = 0; x < source_width; x++) for (x = 0; x < source_width; x++)
{ {
/* Copy over non-transparent pixels. */ if (dispose == BackgroundDispose)
if (PixelGetAlpha (source[x]))
{ {
PixelGetMagickColor (source[x], &pixel); PixelGetMagickColor (source[x], &pixel);
PixelSetMagickColor (dest[x], &pixel); PixelSetMagickColor (dest[x], &pixel);
} }
else
{
/* Copy over non-transparent pixels. */
if (PixelGetAlpha (source[x]))
{
PixelGetMagickColor (source[x], &pixel);
PixelSetMagickColor (dest[x], &pixel);
}
}
} }
PixelSyncIterator(dest_iterator); 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