From 0236be58cd37e9ee6b75e1da6d8c32c05067cb67 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 15 Feb 2019 19:25:39 -0500 Subject: [PATCH] Respect read mask --- MagickCore/compare.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MagickCore/compare.c b/MagickCore/compare.c index 07cb31f34..f60a32722 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -430,6 +430,13 @@ static MagickBooleanType GetAbsoluteDistortion(const Image *image, register ssize_t i; + if ((GetPixelReadMask(image,p) <= (QuantumRange/2)) || + (GetPixelReadMask(reconstruct_image,q) <= (QuantumRange/2))) + { + p+=GetPixelChannels(image); + q+=GetPixelChannels(reconstruct_image); + continue; + } difference=MagickFalse; distance=0.0; Sa=QuantumScale*GetPixelAlpha(image,p); -- 2.40.0