]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Wed, 1 Feb 2017 12:45:55 +0000 (07:45 -0500)
committerCristy <urban-warrior@imagemagick.org>
Wed, 1 Feb 2017 12:45:55 +0000 (07:45 -0500)
MagickCore/identify.c
coders/mpc.c

index e8d7d33fd50ec5c131324a964ab021473b7fbc24..b76c66e1386e4a7ad34b473a434ec74ac7a6b2cd 100644 (file)
@@ -767,7 +767,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       switch (colorspace)
       {
         case RGBColorspace:
-        default:
+        case sRGBColorspace:
         {
           (void) FormatLocaleFile(file,"    Red: %.20g-bit\n",(double)
             channel_statistics[RedPixelChannel].depth);
@@ -795,6 +795,17 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             channel_statistics[GrayPixelChannel].depth);
           break;
         }
+       default:
+        {
+          ssize_t
+            number_channels;
+
+          number_channels=image->number_channels+image->number_meta_channels;
+          for (i=0; i < (ssize_t) number_channels; i++)
+            (void) FormatLocaleFile(file,"    Channel %.20g: %.20g-bit\n",
+              (double) i,(double) channel_statistics[i].depth);
+          break;
+        }
       }
       if (image->alpha_trait != UndefinedPixelTrait)
         (void) FormatLocaleFile(file,"    Alpha: %.20g-bit\n",(double)
@@ -812,7 +823,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       switch (colorspace)
       {
         case RGBColorspace:
-        default:
+        case sRGBColorspace:
         {
           (void) PrintChannelStatistics(file,RedPixelChannel,"Red",1.0/
             scale,channel_statistics);
@@ -840,15 +851,28 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             scale,channel_statistics);
           break;
         }
+       default:
+        {
+          ssize_t
+            number_channels;
+
+          number_channels=image->number_channels+image->number_meta_channels;
+          for (i=0; i < (ssize_t) number_channels; i++)
+          {
+            char
+              channel[MagickPathExtent];
+
+            (void) FormatLocaleString(channel,MagickPathExtent,"Channel %.20g",
+              (double) i);
+            (void) PrintChannelStatistics(file,GrayPixelChannel,channel,1.0/
+              scale,channel_statistics);
+          }
+          break;
+        }
       }
       if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
           scale,channel_statistics);
-      if (image->number_meta_channels != 0)
-        for (i=0; i < (ssize_t) image->number_meta_channels; i++)
-          (void) PrintChannelStatistics(file,(PixelChannel)
-            image->number_channels-image->number_meta_channels+i,"Meta",1.0/
-            scale,channel_statistics);
       if (colorspace != GRAYColorspace)
         {
           (void) FormatLocaleFile(file,"  Image statistics:\n");
@@ -865,7 +889,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       switch (colorspace)
       {
         case RGBColorspace:
-        default:
+        case sRGBColorspace:
         {
           (void) PrintChannelMoments(file,RedPixelChannel,"Red",scale,
             channel_moments);
@@ -893,6 +917,24 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             channel_moments);
           break;
         }
+       default:
+        {
+          ssize_t
+            number_channels;
+
+          number_channels=image->number_channels+image->number_meta_channels;
+          for (i=0; i < (ssize_t) number_channels; i++)
+          {
+            char
+              channel[MagickPathExtent];
+
+            (void) FormatLocaleString(channel,MagickPathExtent,"Channel %.20g",
+              (double) i);
+            (void) PrintChannelMoments(file,GrayPixelChannel,"channel",scale,
+              channel_moments);
+          }
+          break;
+        }
       }
       if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale,
@@ -919,7 +961,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       switch (colorspace)
       {
         case RGBColorspace:
-        default:
+        case sRGBColorspace:
         {
           (void) PrintChannelFeatures(file,RedPixelChannel,"Red",
             channel_features);
@@ -947,6 +989,24 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
             channel_features);
           break;
         }
+       default:
+        {
+          ssize_t
+            number_channels;
+
+          number_channels=image->number_channels+image->number_meta_channels;
+          for (i=0; i < (ssize_t) number_channels; i++)
+          {
+            char
+              channel[MagickPathExtent];
+
+            (void) FormatLocaleString(channel,MagickPathExtent,"Channel %.20g",
+              (double) i);
+            (void) PrintChannelFeatures(file,GrayPixelChannel,channel,
+              channel_features);
+          }
+          break;
+        }
       }
       if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
index 8a2a3cdc00a78137180d31ed99a36aebef792afb..e3e8641c368f9e470ecaf764d50d09b87a8b3a07 100644 (file)
@@ -1146,12 +1146,9 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
           CommandOptionToMnemonic(MagickTypeOptions,image->type));
         (void) WriteBlobString(image,buffer);
       }
-    if (image->colorspace != UndefinedColorspace)
-      {
-        (void) FormatLocaleString(buffer,MagickPathExtent,"colorspace=%s\n",
-          CommandOptionToMnemonic(MagickColorspaceOptions,image->colorspace));
-        (void) WriteBlobString(image,buffer);
-      }
+    (void) FormatLocaleString(buffer,MagickPathExtent,"colorspace=%s\n",
+      CommandOptionToMnemonic(MagickColorspaceOptions,image->colorspace));
+    (void) WriteBlobString(image,buffer);
     if (image->intensity != UndefinedPixelIntensityMethod)
       {
         (void) FormatLocaleString(buffer,MagickPathExtent,