From 5774b2d0239999cb57a7b292c8be3232f97d103d Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 28 Dec 2016 20:49:47 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/332 --- ChangeLog | 2 ++ MagickCore/attribute.c | 1 - MagickCore/colormap.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04c557f04..a686932dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2016-12-26 7.0.4-1 Cristy * Initialize draw_info alpha member to OpaqueAlpha. + * Monochrome images no longer have inverted colors (reference + https://github.com/ImageMagick/ImageMagick/issues/332). 2016-12-18 7.0.4-0 Cristy * Release ImageMagick version 7.0.4-0, GIT revision 19221:d5e8abc:20161218. diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c index e9ca7de75..07d29e311 100644 --- a/MagickCore/attribute.c +++ b/MagickCore/attribute.c @@ -1264,7 +1264,6 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type, status=QuantizeImage(quantize_info,image,exception); quantize_info=DestroyQuantizeInfo(quantize_info); } - status=AcquireImageColormap(image,2,exception); image->alpha_trait=UndefinedPixelTrait; break; } diff --git a/MagickCore/colormap.c b/MagickCore/colormap.c index 1cdde9a56..893c65592 100644 --- a/MagickCore/colormap.c +++ b/MagickCore/colormap.c @@ -116,11 +116,11 @@ MagickExport MagickBooleanType AcquireImageColormap(Image *image, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); image->colors=MagickMax(colors,1); if (image->colormap == (PixelInfo *) NULL) - image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors, + image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors+1, sizeof(*image->colormap)); else image->colormap=(PixelInfo *) ResizeQuantumMemory(image->colormap, - image->colors,sizeof(*image->colormap)); + image->colors+1,sizeof(*image->colormap)); if (image->colormap == (PixelInfo *) NULL) { image->colors=0; -- 2.40.0