From 47a9b9594aee0bb76605dc1a0262b725d91a633f Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 27 Feb 2018 20:03:41 +0100 Subject: [PATCH] Minor refactoring. --- MagickCore/attribute.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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); } /* -- 2.40.0