From 6f94cbbcb5cefde19de8fff03834f3c8cb5f6e6d Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 15 Aug 2013 19:26:34 +0200 Subject: [PATCH] (imagemagick_compute_animated_image): Clean up code slightly --- src/image.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/image.c b/src/image.c index 3c5ee4ce66f..bc9f9ab123a 100644 --- a/src/image.c +++ b/src/image.c @@ -7929,20 +7929,15 @@ imagemagick_compute_animated_image (MagickWand *super_wand, int ino) dest = PixelGetNextIteratorRow (dest_iterator, &dest_width); for (x = 0; x < source_width; x++) { - if (dispose == BackgroundDispose) + /* Normally we only copy over non-transparent pixels, + but if the disposal method is "Background", then we + copy over all pixels. */ + if (dispose == BackgroundDispose || + PixelGetAlpha (source[x])) { 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); } -- 2.39.2