]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33467
authorCristy <urban-warrior@imagemagick.org>
Sat, 3 Feb 2018 17:04:00 +0000 (12:04 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 3 Feb 2018 17:04:00 +0000 (12:04 -0500)
MagickCore/draw.c

index 8f92fbc4da9accaa5b4fd9727d74da1379099978..1d8bb669b29ec7de1df22476335fc86f2fe2a990 100644 (file)
@@ -3485,6 +3485,11 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image,
       offset*=PerceptibleReciprocal(length);
     for (x=bounding_box.x; x < (ssize_t) bounding_box.width; x++)
     {
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+        {
+          q+=GetPixelChannels(image);
+          continue;
+        }
       GetPixelInfoPixel(image,q,&pixel);
       switch (gradient->spread)
       {
@@ -4167,6 +4172,11 @@ RestoreMSCWarning
       /*
         Fill and/or stroke.
       */
+      if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+        {
+          q+=GetPixelChannels(image);
+          continue;
+        }
       fill_alpha=GetFillAlpha(polygon_info[id],mid,fill,draw_info->fill_rule,
         x,y,&stroke_alpha);
       if (draw_info->stroke_antialias == MagickFalse)
@@ -4408,6 +4418,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
+              if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+                {
+                  q+=GetPixelChannels(image);
+                  continue;
+                }
               GetPixelInfoPixel(image,q,&pixel);
               if (IsFuzzyEquivalencePixelInfo(&pixel,&target) == MagickFalse)
                 {
@@ -4467,6 +4482,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
+              if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+                {
+                  q+=GetPixelChannels(image);
+                  continue;
+                }
               GetFillColor(draw_info,x,y,&pixel,exception);
               SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
               q+=GetPixelChannels(image);
@@ -4524,6 +4544,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
+              if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+                {
+                  q+=GetPixelChannels(image);
+                  continue;
+                }
               GetPixelInfoPixel(image,q,&pixel);
               if (IsFuzzyEquivalencePixelInfo(&pixel,&target) == MagickFalse)
                 {
@@ -4579,6 +4604,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image,
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
+              if (GetPixelWriteMask(image,q) <= (QuantumRange/2))
+                {
+                  q+=GetPixelChannels(image);
+                  continue;
+                }
               GetFillColor(draw_info,x,y,&pixel,exception);
               SetPixelViaPixelInfo(image,&pixel,q);
               q+=GetPixelChannels(image);