From 9bca83b6db0b3d6f5e307cc5c4103309a249ea98 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 11 Feb 2017 20:16:04 -0500 Subject: [PATCH] ... --- ChangeLog | 2 ++ MagickCore/pixel.c | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79cf1fe94..97db83a0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ https://blog.awm.jp/2017/02/09/imagemagick-en/). * Return unbiased standard deviation for image statistics (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31377). + * Don't set update trait on alpha channel (private e-mail concerning + -levels-colors option). 2017-02-04 7.0.4-7 Cristy * Release ImageMagick version 7.0.4-7, GIT revision 19513:5783e57:20170204. diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 0a5f0c2ed..4d8c35bc8 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -4321,8 +4321,8 @@ static void LogPixelChannels(const Image *image) register ssize_t i; - (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[%.20g]", - image->filename,(double) image->number_channels); + (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[%08x]", + image->filename,image->channel_mask); for (i=0; i < (ssize_t) image->number_channels; i++) { char @@ -4466,7 +4466,7 @@ MagickExport void InitializePixelChannelMap(Image *image) image->number_channels=(size_t) n; if (image->debug != MagickFalse) LogPixelChannels(image); - SetImageChannelMask(image,image->channel_mask); + SetPixelChannelMask(image,image->channel_mask); } /* @@ -6292,15 +6292,14 @@ MagickExport ChannelType SetPixelChannelMask(Image *image, SetPixelChannelTraits(image,channel,CopyPixelTrait); continue; } - SetPixelChannelTraits(image,channel,UpdatePixelTrait); - continue; - } - if (image->alpha_trait != UndefinedPixelTrait) - { - SetPixelChannelTraits(image,channel,(const PixelTrait) - (UpdatePixelTrait | BlendPixelTrait)); - continue; } + else + if (image->alpha_trait != UndefinedPixelTrait) + { + SetPixelChannelTraits(image,channel,(const PixelTrait) + (UpdatePixelTrait | BlendPixelTrait)); + continue; + } SetPixelChannelTraits(image,channel,UpdatePixelTrait); } if (image->storage_class == PseudoClass) -- 2.40.0