From 29b73a168ecd6503948863e2505df3c3b4628506 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 2 Sep 2019 19:30:07 -0400 Subject: [PATCH] ... --- MagickCore/morphology.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c index 2e7822ba8..18b3fc7d6 100644 --- a/MagickCore/morphology.c +++ b/MagickCore/morphology.c @@ -3195,14 +3195,15 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image, } if (fabs(pixel-p[center+i]) > MagickEpsilon) changes[id]++; + if (quantum_pixels != (const Quantum *) NULL) + { + SetPixelChannel(morphology_image,channel,quantum_pixels[i],q); + continue; + } gamma=PerceptibleReciprocal(gamma); if (count != 0) gamma*=(double) kernel->height*kernel->width/count; - if (quantum_pixels != (const Quantum *) NULL) - SetPixelChannel(morphology_image,channel,quantum_pixels[i],q); - else - SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*pixel), - q); + SetPixelChannel(morphology_image,channel,ClampToQuantum(gamma*pixel),q); } p+=GetPixelChannels(image); q+=GetPixelChannels(morphology_image); -- 2.40.0