]> granicus.if.org Git - imagemagick/commitdiff
The -clip option stopped working, fixed
authorCristy <urban-warrior@imagemagick.org>
Tue, 15 May 2018 23:37:30 +0000 (19:37 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 15 May 2018 23:37:30 +0000 (19:37 -0400)
MagickCore/cache.c
MagickCore/draw.c
MagickCore/image.c
configure

index 81b8af70d607410e7b37424d5b2760124656edc1..a036f8b2fac00b4017c21e2c752b4f8932af366b 100644 (file)
@@ -451,15 +451,18 @@ static MagickBooleanType ClipPixelCacheNexus(Image *image,
       break;
     mask_alpha=QuantumScale*GetPixelWriteMask(image,p);
     if (fabs(mask_alpha) >= MagickEpsilon)
-      for (i=0; i < (ssize_t) image->number_channels; i++)
       {
-        PixelChannel channel = GetPixelChannelChannel(image,i);
-        PixelTrait traits = GetPixelChannelTraits(image,channel);
-        if ((traits & UpdatePixelTrait) == 0)
-          continue;
-        q[i]=ClampToQuantum(MagickOver_((double) p[i],mask_alpha*
-          GetPixelAlpha(image,p),(double) q[i],(double)
-          GetPixelAlpha(image,q)));
+        for (i=0; i < (ssize_t) image->number_channels; i++)
+        {
+          PixelChannel channel = GetPixelChannelChannel(image,i);
+          PixelTrait traits = GetPixelChannelTraits(image,channel);
+          if ((traits & UpdatePixelTrait) == 0)
+            continue;
+          q[i]=ClampToQuantum(MagickOver_((double) p[i],mask_alpha*
+            GetPixelAlpha(image,p),(double) q[i],(double)
+            GetPixelAlpha(image,q)));
+        }
+        SetPixelAlpha(image,GetPixelAlpha(image,p),q);
       }
     p+=GetPixelChannels(image);
     q+=GetPixelChannels(image);
index a53779c72380c5e7925c449811f03228feedcf1c..c6d73d97e019969239f6d1e484749af9073ebd51 100644 (file)
@@ -2439,6 +2439,12 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
     (void) LogMagickEvent(DrawEvent,GetMagickModule(),"begin draw-image");
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
+  if (image->alpha_trait == UndefinedPixelTrait)
+    {
+      status=SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
+      if (status == MagickFalse)
+        return(status);
+    }
   primitive=(char *) NULL;
   if (*draw_info->primitive != '@')
     primitive=AcquireString(draw_info->primitive);
@@ -4695,8 +4701,6 @@ RestoreMSCWarning
   /*
     Draw polygon or line.
   */
-  if (image->alpha_trait == UndefinedPixelTrait)
-    (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   start_y=(ssize_t) ceil(bounds.y1-0.5);
   stop_y=(ssize_t) floor(bounds.y2+0.5);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
index 837c087c8f5e1703fa95909d87657e6a87e16892..21be905c59cc54fa06cd851f8c33a20d0c119b36 100644 (file)
@@ -743,7 +743,7 @@ MagickExport MagickBooleanType ClipImagePath(Image *image,const char *pathname,
       if (SetImageStorageClass(clip_mask,DirectClass,exception) == MagickFalse)
         return(MagickFalse);
     }
-  if (inside != MagickFalse)
+  if (inside == MagickFalse)
     (void) NegateImage(clip_mask,MagickFalse,exception);
   (void) FormatLocaleString(clip_mask->magick_filename,MagickPathExtent,
     "8BIM:1999,2998:%s\nPS",pathname);
index fde729ba849d41ff01cba764fec3ce7b4d479f94..f12e32af4f01888f97f05c4bc681b053a74be466 100755 (executable)
--- a/configure
+++ b/configure
@@ -4554,7 +4554,7 @@ MAGICK_PATCHLEVEL_VERSION=33
 
 MAGICK_VERSION=7.0.7-33
 
-MAGICK_GIT_REVISION=14318:9de21a759:20180515
+MAGICK_GIT_REVISION=14321:8e0117484:20180515
 
 
 # Substitute library versioning