emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113897: (imagemagick_compute_animated_image): Respe


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r113897: (imagemagick_compute_animated_image): Respect the GIF disposal methods.
Date: Thu, 15 Aug 2013 17:20:10 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113897
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Thu 2013-08-15 19:20:06 +0200
message:
  (imagemagick_compute_animated_image): Respect the GIF disposal methods.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/image.c                    image.c-20091113204419-o5vbwnq5f7feedwu-2969
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-15 16:37:15 +0000
+++ b/src/ChangeLog     2013-08-15 17:20:06 +0000
@@ -1,3 +1,8 @@
+2013-08-15  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * image.c (imagemagick_compute_animated_image): Respect the GIF
+       disposal methods.
+
 2013-08-15  Ken Brown  <address@hidden>
 
        * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.

=== modified file 'src/image.c'
--- a/src/image.c       2013-08-15 16:28:42 +0000
+++ b/src/image.c       2013-08-15 17:20:06 +0000
@@ -7887,17 +7887,20 @@
   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)
        {
@@ -7926,12 +7929,20 @@
          dest = PixelGetNextIteratorRow (dest_iterator, &dest_width);
          for (x = 0; x < source_width; x++)
            {
-             /* Copy over non-transparent pixels. */
-             if (PixelGetAlpha (source[x]))
+             if (dispose == BackgroundDispose)
                {
                  PixelGetMagickColor (source[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);
        }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]