]> granicus.if.org Git - imagemagick/commitdiff
https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=36050
authorCristy <mikayla-grace@urban-warrior.org>
Sat, 18 May 2019 12:58:31 +0000 (08:58 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Sat, 18 May 2019 12:58:31 +0000 (08:58 -0400)
MagickCore/morphology.c

index f16f66c1cff70e4008ac5c0752e942ed7b7059f5..fa5a01bff5425f0387df125b079ece2c7d9b6b3e 100644 (file)
@@ -3055,8 +3055,8 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image,
                   {
                     if (*k > 0.7)
                       {
-                        if ((double) pixels[i] < pixel)
-                          pixel=(double) pixels[i];
+                        if ((double) pixels[i] < minimum)
+                          minimum=(double) pixels[i];
                       }
                     else
                       if (*k < 0.3)
@@ -3071,9 +3071,10 @@ static ssize_t MorphologyPrimitive(const Image *image,Image *morphology_image,
               }
               pixels+=(image->columns-1)*GetPixelChannels(image);
             }
-            pixel-=maximum;
-            if (pixel < 0.0)
-              pixel=0.0;
+            minimum-=maximum;
+            if (minimum < 0.0)
+              minimum=0.0;
+            pixel=minimum;
             if (method ==  ThinningMorphology)
               pixel=(double) p[center+i]-pixel;
             else