% July 1992 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
%
% o length: Specifies the length of the magick string.
%
-%
*/
static MagickBooleanType IsDCX(const unsigned char *magick,const size_t length)
{
%
% o length: Specifies the length of the magick string.
%
-%
*/
static MagickBooleanType IsPCX(const unsigned char *magick,const size_t length)
{
{
packet=(unsigned char) ReadBlobByte(image);
if (EOFBlob(image) != MagickFalse)
- break;
+ ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
*p++=packet;
pcx_packets--;
}
{
packet=(unsigned char) ReadBlobByte(image);
if (EOFBlob(image) != MagickFalse)
- break;
+ ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
if ((packet & 0xc0) != 0xc0)
{
*p++=packet;
count=(ssize_t) (packet & 0x3f);
packet=(unsigned char) ReadBlobByte(image);
if (EOFBlob(image) != MagickFalse)
- break;
+ ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
for ( ; count != 0; count--)
{
*p++=packet;
}
}
if (image->storage_class == DirectClass)
- image->matte=pcx_info.planes > 3 ? MagickTrue : MagickFalse;
+ image->alpha_trait=pcx_info.planes > 3 ? BlendPixelTrait :
+ UndefinedPixelTrait;
else
if ((pcx_info.version == 5) ||
((pcx_info.bits_per_pixel*pcx_info.planes) == 1))
SetPixelRed(image,ScaleCharToQuantum(*r++),q);
SetPixelGreen(image,ScaleCharToQuantum(*r++),q);
SetPixelBlue(image,ScaleCharToQuantum(*r++),q);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
SetPixelAlpha(image,ScaleCharToQuantum(*r++),q);
}
q+=GetPixelChannels(image);
if ((image->storage_class == DirectClass) || (image->colors > 256))
{
pcx_info.planes=3;
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
pcx_info.planes++;
}
pcx_info.bytes_per_line=(unsigned short) (((size_t) image->columns*