From: cristy Date: Tue, 21 Jan 2014 19:26:29 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2815 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fdfe6885add3830afc7749f7410a9edab86dd51;p=imagemagick --- 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