From: Dirk Lemstra Date: Tue, 27 Feb 2018 19:03:41 +0000 (+0100) Subject: Minor refactoring. X-Git-Tag: 7.0.7-25~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47a9b9594aee0bb76605dc1a0262b725d91a633f;p=imagemagick Minor refactoring. --- diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c index 878e94b71..3059de2dd 100644 --- a/MagickCore/attribute.c +++ b/MagickCore/attribute.c @@ -727,8 +727,8 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, CacheView *image_view; - ImageType - type; + MagickBooleanType + bilevel; register ssize_t x; @@ -747,7 +747,7 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, return(MagickTrue); if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) return(MagickFalse); - type=BilevelType; + bilevel=MagickTrue; image_view=AcquireVirtualCacheView(image,exception); for (y=0; y < (ssize_t) image->rows; y++) { @@ -758,18 +758,16 @@ MagickExport MagickBooleanType IdentifyImageMonochrome(const Image *image, { if (IsPixelMonochrome(image,p) == MagickFalse) { - type=UndefinedType; + bilevel=MagickFalse; break; } p+=GetPixelChannels(image); } - if (type == UndefinedType) + if (bilevel == MagickFalse) break; } image_view=DestroyCacheView(image_view); - if (type == BilevelType) - return(MagickTrue); - return(MagickFalse); + return(bilevel); } /*