]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 22 Aug 2014 12:59:44 +0000 (12:59 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 22 Aug 2014 12:59:44 +0000 (12:59 +0000)
MagickCore/compare.c

index b6d37cf0cc866291acd0e0b418ad8dacacf67151..c4e903bdc56241aa49359f8eb2345f9f5bed0666 100644 (file)
 %
 */
 
+static size_t GetImageChannels(const Image *image)
+{
+  register ssize_t
+    i;
+
+  size_t
+    channels;
+
+  channels=0;
+  for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+  {
+    PixelChannel channel=GetPixelChannelChannel(image,i);
+    PixelTrait traits=GetPixelChannelTraits(image,channel);
+    if ((traits & UpdatePixelTrait) != 0)
+      channels++;
+  }
+  return(channels == 0 ? 1 : channels);
+}
+
 static inline MagickBooleanType ValidateImageMorphology(
   const Image *restrict image,const Image *restrict reconstruct_image)
 {
   /*
     Does the image match the reconstructed image morphology?
-  if (image->number_channels != reconstruct_image->number_channels)
-    return(MagickFalse);
   */
+  if (GetImageChannels(image) != GetImageChannels(reconstruct_image))
+    return(MagickFalse);
   return(MagickTrue);
 }
 
@@ -448,25 +467,6 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image,
   return(status);
 }
 
-static size_t GetImageChannels(const Image *image)
-{
-  register ssize_t
-    i;
-
-  size_t
-    channels;
-
-  channels=0;
-  for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
-  {
-    PixelChannel channel=GetPixelChannelChannel(image,i);
-    PixelTrait traits=GetPixelChannelTraits(image,channel);
-    if ((traits & UpdatePixelTrait) != 0)
-      channels++;
-  }
-  return(channels == 0 ? 1 : channels);
-}
-
 static MagickBooleanType GetFuzzDistortion(const Image *image,
   const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
 {