From: cristy Date: Tue, 10 Aug 2010 02:12:17 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9061 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfe2925e428feba54c3998f7b6df9180a0d806bd;p=imagemagick --- diff --git a/magick/quantum-export.c b/magick/quantum-export.c index 6dd92989a..071cd89a8 100644 --- a/magick/quantum-export.c +++ b/magick/quantum-export.c @@ -946,19 +946,19 @@ MagickExport size_t ExportQuantumPixels(const Image *image, *q='\0'; *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 7; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); - *q|=(((int) pixel == 0 ? 0x00 : 0x01) << 6); + *q|=(((int) pixel != 0 ? 0x00 : 0x01) << 6); p++; *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 5; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); - *q|=(((int) pixel == 0 ? 0x00 : 0x01) << 4); + *q|=(((int) pixel != 0 ? 0x00 : 0x01) << 4); p++; *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 3; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); - *q|=(((int) pixel == 0 ? 0x00 : 0x01) << 2); + *q|=(((int) pixel != 0 ? 0x00 : 0x01) << 2); p++; *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 1; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); - *q|=(((int) pixel == 0 ? 0x00 : 0x01) << 0); + *q|=(((int) pixel != 0 ? 0x00 : 0x01) << 0); p++; q++; } @@ -971,7 +971,7 @@ MagickExport size_t ExportQuantumPixels(const Image *image, (7-bit); pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); - *q|=(((int) pixel == 0 ? 0x00 : 0x01) << (unsigned char) + *q|=(((int) pixel != 0 ? 0x00 : 0x01) << (unsigned char) (7-bit-1)); p++; } diff --git a/magick/quantum-import.c b/magick/quantum-import.c index b066b1dbf..915816aae 100644 --- a/magick/quantum-import.c +++ b/magick/quantum-import.c @@ -1066,7 +1066,7 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, q->green=q->red; q->blue=q->red; q->opacity=(Quantum) (((*p) & (1UL << (unsigned char) (6-bit))) - != 0 ? TransparentOpacity : OpaqueOpacity); + == 0 ? TransparentOpacity : OpaqueOpacity); q++; } p++; @@ -1077,8 +1077,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, q->red=(Quantum) (pixel != 0 ? 0 : QuantumRange); q->green=q->red; q->blue=q->red; - q->opacity=(Quantum) (((*p) & (1UL << (unsigned char) (6-bit))) != 0 - ? TransparentOpacity : OpaqueOpacity); + q->opacity=(Quantum) (((*p) & (1UL << (unsigned char) (6-bit))) + == 0 ? TransparentOpacity : OpaqueOpacity); q++; } if (bit != 0)