From 4c27e791a3294ba6552a6d9c30ac1c30ac4be07c Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 10 Aug 2010 01:33:20 +0000 Subject: [PATCH] --- magick/quantum-export.c | 10 +++++----- magick/quantum-import.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/magick/quantum-export.c b/magick/quantum-export.c index 7c1cdb025..3653f0551 100644 --- a/magick/quantum-export.c +++ b/magick/quantum-export.c @@ -944,19 +944,19 @@ MagickExport size_t ExportQuantumPixels(const Image *image, for (x=((ssize_t) number_pixels-3); x > 0; x-=4) { *q='\0'; - *q|=(PixelIntensityToQuantum(p) < threshold ? black : white) << 7; + *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 7; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); *q|=(((int) pixel != 0 ? black : white) << 6); p++; - *q|=(PixelIntensityToQuantum(p) < threshold ? black : white) << 5; + *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 5; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); *q|=(((int) pixel != 0 ? black : white) << 4); p++; - *q|=(PixelIntensityToQuantum(p) < threshold ? black : white) << 3; + *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 3; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); *q|=(((int) pixel != 0 ? black : white) << 2); p++; - *q|=(PixelIntensityToQuantum(p) < threshold ? black : white) << 1; + *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << 1; pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); *q|=(((int) pixel != 0 ? black : white) << 0); p++; @@ -967,7 +967,7 @@ MagickExport size_t ExportQuantumPixels(const Image *image, *q='\0'; for (bit=0; bit <= (ssize_t) (number_pixels % 4); bit+=2) { - *q|=(PixelIntensityToQuantum(p) < threshold ? black : white) << + *q|=(PixelIntensityToQuantum(p) > threshold ? black : white) << (7-bit); pixel=(unsigned char) (p->opacity == OpaqueOpacity ? 0x00 : 0x01); diff --git a/magick/quantum-import.c b/magick/quantum-import.c index a6798d3bb..b066b1dbf 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++; -- 2.40.0