From 1de38c68936b1b4906051c0f589913308bbc0422 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 8 Sep 2019 11:12:12 -0400 Subject: [PATCH] https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=36613 --- coders/pcx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coders/pcx.c b/coders/pcx.c index 600603c69..32a96a765 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -578,13 +578,13 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) for (x=0; x < ((ssize_t) image->columns-7); x+=8) { for (bit=7; bit >= 0; bit--) - *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x01 : 0x00); + *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x00 : 0x01); p++; } if ((image->columns % 8) != 0) { for (bit=7; bit >= (ssize_t) (8-(image->columns % 8)); bit--) - *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x01 : 0x00); + *r++=(unsigned char) ((*p) & (0x01 << bit) ? 0x00 : 0x01); p++; } break; @@ -1150,7 +1150,7 @@ static MagickBooleanType WritePCXImage(const ImageInfo *image_info,Image *image, for (x=0; x < (ssize_t) image->columns; x++) { byte<<=1; - if (GetPixelLuma(image,p) >= (QuantumRange/2.0)) + if (GetPixelLuma(image,p) < (QuantumRange/2.0)) byte|=0x01; bit++; if (bit == 8) -- 2.49.0