]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 18 Jan 2014 15:58:31 +0000 (15:58 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 18 Jan 2014 15:58:31 +0000 (15:58 +0000)
MagickCore/compare.c

index 948961aeea82ee63603784d183f038f36515f16c..5c15e5f0624d99b0f2af34fe47d2ecebbde8cc03 100644 (file)
@@ -42,6 +42,7 @@
 */
 #include "MagickCore/studio.h"
 #include "MagickCore/artifact.h"
+#include "MagickCore/attribute.h"
 #include "MagickCore/cache-view.h"
 #include "MagickCore/channel.h"
 #include "MagickCore/client.h"
@@ -1169,6 +1170,13 @@ static MagickBooleanType GetPerceptualHashDistortion(const Image *image,
   image_moments=(ChannelMoments *) RelinquishMagickMemory(image_moments);
   reconstruct_moments=(ChannelMoments *) RelinquishMagickMemory(
     reconstruct_moments);
+  if ((IsImageGray(blur_image,exception) != MagickFalse) ||
+      (IsImageGray(blur_reconstruct,exception) != MagickFalse))
+    {
+      blur_reconstruct=DestroyImage(blur_reconstruct);
+      blur_image=DestroyImage(blur_image);
+      return(MagickTrue);
+    }
   /*
     Compute perceptual hash in the HCLP colorspace.
   */