From 4fdfe6885add3830afc7749f7410a9edab86dd51 Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 21 Jan 2014 19:26:29 +0000 Subject: [PATCH] --- MagickWand/compare.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/MagickWand/compare.c b/MagickWand/compare.c index b7f71f4d8..8aac025cc 100644 --- a/MagickWand/compare.c +++ b/MagickWand/compare.c @@ -954,10 +954,23 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, difference_image=CompareImages(image,reconstruct_image,metric,&distortion, exception); else - if ((similarity_image == (Image *) NULL) && - (metric != PerceptualHashErrorMetric)) - ThrowCompareException(OptionError,"ImageWidthsOrHeightsDiffer", - image->filename) + if (similarity_image == (Image *) NULL) + { + unsigned long + height, + width; + + width=image->columns; + if (reconstruct_image->columns > width) + width=reconstruct_image->columns; + height=image->rows; + if (reconstruct_image->rows > height) + height=reconstruct_image->rows; + if ((SetImageExtent(image,width,height,exception) != MagickFalse) && + (SetImageExtent(reconstruct_image,width,height,exception) != MagickFalse)) + difference_image=CompareImages(image,reconstruct_image,metric, + &distortion,exception); + } else { Image -- 2.50.1