]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Tue, 15 May 2018 12:55:04 +0000 (08:55 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 15 May 2018 12:55:04 +0000 (08:55 -0400)
MagickCore/image.c
configure

index a021e99388e21e6426670ea2d92ce9aa59e0cd53..6a83270846821d32e3849e74ce14fff75b12f1a6 100644 (file)
@@ -2239,7 +2239,7 @@ MagickExport MagickBooleanType ResetImagePixels(Image *image,
   assert(image->signature == MagickCoreSignature);
   pixels=AcquirePixelCachePixels(image,&length,exception);
   if (pixels != (void *) NULL)
-    {   
+    {
       /*
         Reset in-core image pixels.
       */
@@ -2305,9 +2305,11 @@ MagickExport MagickBooleanType ResetImagePixels(Image *image,
 %
 %    o image: the image.
 %
-%    o Alpha: the level of transparency: 0 is fully transparent and QuantumRange
+%    o alpha: the level of transparency: 0 is fully transparent and QuantumRange
 %      is fully opaque.
 %
+%    o exception: return any errors or warnings in this structure.
+%
 */
 MagickExport MagickBooleanType SetImageAlpha(Image *image,const Quantum alpha,
   ExceptionInfo *exception)
@@ -2316,6 +2318,7 @@ MagickExport MagickBooleanType SetImageAlpha(Image *image,const Quantum alpha,
     *image_view;
 
   MagickBooleanType
+    set_opaque,
     status;
 
   ssize_t
@@ -2325,6 +2328,8 @@ MagickExport MagickBooleanType SetImageAlpha(Image *image,const Quantum alpha,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
   assert(image->signature == MagickCoreSignature);
+  set_opaque=(image->alpha_trait == UndefinedPixelTrait) ? MagickTrue :
+    MagickFalse;
   image->alpha_trait=BlendPixelTrait;
   status=MagickTrue;
   image_view=AcquireAuthenticCacheView(image,exception);
@@ -2350,7 +2355,10 @@ MagickExport MagickBooleanType SetImageAlpha(Image *image,const Quantum alpha,
       }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      SetPixelAlpha(image,alpha,q);
+      if (set_opaque != MagickFalse)
+        SetPixelAlpha(image,OpaqueAlpha,q);
+      else
+        SetPixelAlpha(image,alpha,q);
       q+=GetPixelChannels(image);
     }
     if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
index 8270e15d74f98474404f9ec32edec61455886f67..fde729ba849d41ff01cba764fec3ce7b4d479f94 100755 (executable)
--- a/configure
+++ b/configure
@@ -4554,7 +4554,7 @@ MAGICK_PATCHLEVEL_VERSION=33
 
 MAGICK_VERSION=7.0.7-33
 
-MAGICK_GIT_REVISION=14312:03bf684ec:20180514
+MAGICK_GIT_REVISION=14318:9de21a759:20180515
 
 
 # Substitute library versioning