diff options
| author | Lars Magne Ingebrigtsen | 2013-08-15 19:20:06 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2013-08-15 19:20:06 +0200 |
| commit | a5b5f73f32a8af8a45a252ed13a381d7526ad1b7 (patch) | |
| tree | 41fbf8b32994e66ffa95cbb1d4b8dd9969cd578c /src | |
| parent | b74f0d960f8c297dcaa125f3af051bd1a34869a5 (diff) | |
| download | emacs-a5b5f73f32a8af8a45a252ed13a381d7526ad1b7.tar.gz emacs-a5b5f73f32a8af8a45a252ed13a381d7526ad1b7.zip | |
(imagemagick_compute_animated_image): Respect the GIF disposal methods.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/image.c | 17 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c12b32ebc71..028c33848a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * image.c (imagemagick_compute_animated_image): Respect the GIF | ||
| 4 | disposal methods. | ||
| 5 | |||
| 1 | 2013-08-15 Ken Brown <kbrown@cornell.edu> | 6 | 2013-08-15 Ken Brown <kbrown@cornell.edu> |
| 2 | 7 | ||
| 3 | * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC. | 8 | * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC. |
diff --git a/src/image.c b/src/image.c index 3cab72edf74..3c5ee4ce66f 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7887,17 +7887,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino) | |||
| 7887 | else | 7887 | else |
| 7888 | composite_wand = animation_cache; | 7888 | composite_wand = animation_cache; |
| 7889 | 7889 | ||
| 7890 | for (i = max (1, animation_index); i <= ino; i++) | 7890 | for (i = max (1, animation_index + 1); i <= ino; i++) |
| 7891 | { | 7891 | { |
| 7892 | MagickWand *sub_wand; | 7892 | MagickWand *sub_wand; |
| 7893 | PixelIterator *source_iterator, *dest_iterator; | 7893 | PixelIterator *source_iterator, *dest_iterator; |
| 7894 | PixelWand **source, **dest; | 7894 | PixelWand **source, **dest; |
| 7895 | size_t source_width, dest_width; | 7895 | size_t source_width, dest_width; |
| 7896 | MagickPixelPacket pixel; | 7896 | MagickPixelPacket pixel; |
| 7897 | DisposeType dispose; | ||
| 7897 | 7898 | ||
| 7898 | MagickSetIteratorIndex (super_wand, i); | 7899 | MagickSetIteratorIndex (super_wand, i); |
| 7899 | sub_wand = MagickGetImage (super_wand); | 7900 | sub_wand = MagickGetImage (super_wand); |
| 7900 | 7901 | ||
| 7902 | dispose = MagickGetImageDispose (sub_wand); | ||
| 7903 | |||
| 7901 | source_iterator = NewPixelIterator (sub_wand); | 7904 | source_iterator = NewPixelIterator (sub_wand); |
| 7902 | if (! source_iterator) | 7905 | if (! source_iterator) |
| 7903 | { | 7906 | { |
| @@ -7926,12 +7929,20 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino) | |||
| 7926 | dest = PixelGetNextIteratorRow (dest_iterator, &dest_width); | 7929 | dest = PixelGetNextIteratorRow (dest_iterator, &dest_width); |
| 7927 | for (x = 0; x < source_width; x++) | 7930 | for (x = 0; x < source_width; x++) |
| 7928 | { | 7931 | { |
| 7929 | /* Copy over non-transparent pixels. */ | 7932 | if (dispose == BackgroundDispose) |
| 7930 | if (PixelGetAlpha (source[x])) | ||
| 7931 | { | 7933 | { |
| 7932 | PixelGetMagickColor (source[x], &pixel); | 7934 | PixelGetMagickColor (source[x], &pixel); |
| 7933 | PixelSetMagickColor (dest[x], &pixel); | 7935 | PixelSetMagickColor (dest[x], &pixel); |
| 7934 | } | 7936 | } |
| 7937 | else | ||
| 7938 | { | ||
| 7939 | /* Copy over non-transparent pixels. */ | ||
| 7940 | if (PixelGetAlpha (source[x])) | ||
| 7941 | { | ||
| 7942 | PixelGetMagickColor (source[x], &pixel); | ||
| 7943 | PixelSetMagickColor (dest[x], &pixel); | ||
| 7944 | } | ||
| 7945 | } | ||
| 7935 | } | 7946 | } |
| 7936 | PixelSyncIterator(dest_iterator); | 7947 | PixelSyncIterator(dest_iterator); |
| 7937 | } | 7948 | } |