From 3889d153c1a0232697d239c8a51151f87048a432 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 22 Dec 2017 19:42:13 -0500 Subject: [PATCH] ... --- MagickCore/identify.c | 25 ++++++++----------------- coders/json.c | 24 ++++++++---------------- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/MagickCore/identify.c b/MagickCore/identify.c index 5b19ad459..cce4b2414 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -486,9 +486,6 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, ChannelStatistics *channel_statistics; - ColorspaceType - colorspace; - const char *artifact, *locate, @@ -555,8 +552,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, if (channel_statistics == (ChannelStatistics *) NULL) return(MagickFalse); (void) FormatLocaleFile(file,"Channel %s locations:\n",locate); - colorspace=GetImageColorspaceType(image,exception); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: case sRGBColorspace: @@ -723,13 +719,8 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, } (void) FormatLocaleFile(file," Units: %s\n",CommandOptionToMnemonic( MagickResolutionOptions,(ssize_t) image->units)); - colorspace=GetImageColorspaceType(image,exception); (void) FormatLocaleFile(file," Colorspace: %s\n",CommandOptionToMnemonic( - MagickColorspaceOptions,(ssize_t) colorspace)); - if (colorspace != image->colorspace) - (void) FormatLocaleFile(file," Base colorspace: %s\n", - CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) - image->colorspace)); + MagickColorspaceOptions,(ssize_t) image->colorspace)); type=GetImageType(image); (void) FormatLocaleFile(file," Type: %s\n",CommandOptionToMnemonic( MagickTypeOptions,(ssize_t) type)); @@ -774,7 +765,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, (void) FormatLocaleFile(file," Depth: %.20g/%.20g-bit\n",(double) image->depth,(double) depth); (void) FormatLocaleFile(file," Channel depth:\n"); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: case sRGBColorspace: @@ -826,7 +817,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, (void) FormatLocaleFile(file," Channel statistics:\n"); (void) FormatLocaleFile(file," Pixels: %.20g\n",(double) image->columns*image->rows); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: case sRGBColorspace: @@ -875,7 +866,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/ scale,channel_statistics); - if (colorspace != GRAYColorspace) + if (image->colorspace != GRAYColorspace) { (void) FormatLocaleFile(file," Image statistics:\n"); (void) PrintChannelStatistics(file,CompositePixelChannel,"Overall", @@ -888,7 +879,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, { scale=(double) ((1UL << image->depth)-1); (void) FormatLocaleFile(file," Channel moments:\n"); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: case sRGBColorspace: @@ -937,7 +928,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale, channel_moments); - if (colorspace != GRAYColorspace) + if (image->colorspace != GRAYColorspace) { (void) FormatLocaleFile(file," Image moments:\n"); (void) PrintChannelMoments(file,CompositePixelChannel,"Overall",scale, @@ -956,7 +947,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, { (void) FormatLocaleFile(file," Channel features (horizontal, vertical, " "left and right diagonals, average):\n"); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: case sRGBColorspace: diff --git a/coders/json.c b/coders/json.c index c445414c2..e2566cb93 100644 --- a/coders/json.c +++ b/coders/json.c @@ -932,9 +932,6 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, char *url; - ColorspaceType - colorspace; - const char *artifact, *locate, @@ -1069,8 +1066,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelLocations(file,image,AlphaPixelChannel,"Alpha", type,max_locations,MagickTrue,channel_statistics); - colorspace=GetImageColorspaceType(image,exception); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: default: @@ -1109,13 +1105,9 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, /* Detail channel depth and extrema. */ - colorspace=GetImageColorspaceType(image,exception); JSONFormatLocaleFile(file," \"colorspace\": %s,\n", - CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace)); - if (image->colorspace != colorspace) - JSONFormatLocaleFile(file," \"baseColorspace\": %s,\n", - CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) - image->colorspace)); + CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) + image->colorspace)); channel_statistics=(ChannelStatistics *) NULL; channel_moments=(ChannelMoments *) NULL; channel_phash=(ChannelPerceptualHash *) NULL; @@ -1148,7 +1140,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) FormatLocaleFile(file," \"alpha\": %.20g,\n",(double) channel_statistics[AlphaPixelChannel].depth); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: default: @@ -1189,7 +1181,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, { (void) FormatLocaleFile(file," \"pixels\": %.20g,\n", channel_statistics[CompositePixelChannel].area); - if (colorspace != GRAYColorspace) + if (image->colorspace != GRAYColorspace) { (void) FormatLocaleFile(file," \"imageStatistics\": {\n"); (void) PrintChannelStatistics(file,(PixelChannel) MaxPixelChannels, @@ -1200,7 +1192,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/scale, MagickTrue,channel_statistics); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: default: @@ -1242,7 +1234,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",MagickTrue, channel_moments); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: default: @@ -1292,7 +1284,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",MagickTrue, channel_features); - switch (colorspace) + switch (image->colorspace) { case RGBColorspace: default: -- 2.40.0