From: ImageMagick Date: Tue, 13 Feb 2018 15:02:58 +0000 (-0500) Subject: Revert "Fix previous image references in OptimizeImageLayers (#983)" (#984) X-Git-Tag: 7.0.7-23~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91fd0ac1dda4e0d1109ac70080f55b5286b6abc5;p=imagemagick Revert "Fix previous image references in OptimizeImageLayers (#983)" (#984) This reverts commit 79e2db21148e6aeb2aef5218728d70ca577d6a57. --- diff --git a/MagickCore/layer.c b/MagickCore/layer.c index 94f917016..567a0a669 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -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);