]> granicus.if.org Git - imagemagick/commitdiff
Revert "Fix previous image references in OptimizeImageLayers (#983)" (#984)
authorImageMagick <urban-warrior@users.noreply.github.com>
Tue, 13 Feb 2018 15:02:58 +0000 (10:02 -0500)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2018 15:02:58 +0000 (10:02 -0500)
This reverts commit 79e2db21148e6aeb2aef5218728d70ca577d6a57.

MagickCore/layer.c

index 94f91701695a9f23263cd8c85379437cdcce564e..567a0a669582259fcc75b28f2e613f8c0967db34 100644 (file)
@@ -1096,7 +1096,8 @@ static Image *OptimizeLayerFrames(const Image *image,
         dup_bounds.width=dup_bounds.height=0; /* no dup, no pixel added */
         if ( add_frames )
           {
-            dup_image=CloneImage(curr->previous,0,0,MagickTrue,exception);
+            dup_image=CloneImage(curr->previous,curr->previous->page.width,
+                curr->previous->page.height,MagickTrue,exception);
             if (dup_image == (Image *) NULL)
               {
                 bounds=(RectangleInfo *) RelinquishMagickMemory(bounds);
@@ -1123,7 +1124,8 @@ static Image *OptimizeLayerFrames(const Image *image,
         /*
           Now compare against a simple background disposal
         */
-        bgnd_image=CloneImage(curr->previous,0,0,MagickTrue,exception);
+        bgnd_image=CloneImage(curr->previous,curr->previous->page.width,
+          curr->previous->page.height,MagickTrue,exception);
         if (bgnd_image == (Image *) NULL)
           {
             bounds=(RectangleInfo *) RelinquishMagickMemory(bounds);
@@ -1278,7 +1280,8 @@ static Image *OptimizeLayerFrames(const Image *image,
           bgnd_image=DestroyImage(bgnd_image);
         if ( disposals[i-1] == NoneDispose )
           {
-            prev_image=ReferenceImage(curr->previous);
+            prev_image=CloneImage(curr->previous,curr->previous->page.width,
+              curr->previous->page.height,MagickTrue,exception);
             if (prev_image == (Image *) NULL)
               {
                 bounds=(RectangleInfo *) RelinquishMagickMemory(bounds);