]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Mon, 2 Sep 2019 23:30:07 +0000 (19:30 -0400)
committerCristy <urban-warrior@imagemagick.org>
Mon, 2 Sep 2019 23:30:07 +0000 (19:30 -0400)
MagickCore/morphology.c

index 2e7822ba86521393b1adeaa5b78444080ca17aec..18b3fc7d65a31b0107bdcb9d503b551c1e3ceb67 100644 (file)
@@ -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);