From 232509c5b9af5519f8005fa2a94ffb3f9830cc18 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 22 Feb 2018 23:46:41 +0900 Subject: [PATCH] Revert "Revert "Fix previous image references in OptimizeImageLayers (#983)" (#984)" (#993) Commit 91fd0ac1dda4e0d1109ac70080f55b5286b6abc5 can be safely reverted because commit b5a7073da902c79264ef8d3ccc8dd715fed8222d has same effects in terms of intermediate image dimensions. --- MagickCore/layer.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/MagickCore/layer.c b/MagickCore/layer.c index 2fb707f12..d22d072b9 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -1096,8 +1096,7 @@ 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,curr->previous->columns, - curr->previous->rows,MagickTrue,exception); + dup_image=CloneImage(curr->previous,0,0,MagickTrue,exception); if (dup_image == (Image *) NULL) { bounds=(RectangleInfo *) RelinquishMagickMemory(bounds); @@ -1124,8 +1123,7 @@ static Image *OptimizeLayerFrames(const Image *image, /* Now compare against a simple background disposal */ - bgnd_image=CloneImage(curr->previous,curr->previous->columns, - curr->previous->rows,MagickTrue,exception); + bgnd_image=CloneImage(curr->previous,0,0,MagickTrue,exception); if (bgnd_image == (Image *) NULL) { bounds=(RectangleInfo *) RelinquishMagickMemory(bounds); @@ -1280,8 +1278,7 @@ static Image *OptimizeLayerFrames(const Image *image, bgnd_image=DestroyImage(bgnd_image); if ( disposals[i-1] == NoneDispose ) { - prev_image=CloneImage(curr->previous,curr->columns, - curr->rows,MagickTrue,exception); + prev_image=ReferenceImage(curr->previous); if (prev_image == (Image *) NULL) { bounds=(RectangleInfo *) RelinquishMagickMemory(bounds); -- 2.40.0