]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 21 Jan 2014 19:26:29 +0000 (19:26 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 21 Jan 2014 19:26:29 +0000 (19:26 +0000)
MagickWand/compare.c

index b7f71f4d8fce36b46f38a50d2e7c1dbe73616216..8aac025cca2c677805db7efbbc6d0c81b0722566 100644 (file)
@@ -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