]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 10 Aug 2010 02:12:17 +0000 (02:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 10 Aug 2010 02:12:17 +0000 (02:12 +0000)
magick/quantum-export.c
magick/quantum-import.c

index 6dd92989aeccc4488c897dd932e6af0b777fb591..071cd89a8712a13ee38407b610a4b7944553f9b4 100644 (file)
@@ -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++;
               }
index b066b1dbf145a0955b9db8317305bb2dad67a347..915816aae6a32427cdf2ca361bb246fe0a75ce1f 100644 (file)
@@ -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)