From: cristy Date: Wed, 15 Sep 2010 01:38:33 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~8925 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3843318dc3960261b770876a35192e39be86883c;p=imagemagick --- diff --git a/coders/tga.c b/coders/tga.c index 3d31beeba..ebfd74e3c 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -223,7 +223,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) */ image->columns=tga_info.width; image->rows=tga_info.height; - image->matte=tga_info.bits_per_pixel == 32 ? MagickTrue : MagickFalse; + image->matte=(tga_info.attributes & 0x0FU) != 0 ? MagickTrue : MagickFalse; if ((tga_info.image_type != TGAColormap) && (tga_info.image_type != TGARLEColormap)) image->depth=(size_t) ((tga_info.bits_per_pixel <= 8) ? 8 : @@ -425,7 +425,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception) (1UL*(j & 0xe0) >> 5),range); pixel.blue=ScaleAnyToQuantum(1UL*(j & 0x1f),range); if (image->matte != MagickFalse) - pixel.opacity=(k & 0x80) != 0 ? (Quantum) OpaqueOpacity : + pixel.opacity=(k & 0x80) == 0 ? (Quantum) OpaqueOpacity : (Quantum) TransparentOpacity; if (image->storage_class == PseudoClass) index=ConstrainColormapIndex(image,((size_t) k << 8)+j);