}
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(CorruptImageError,"NegativeOrZeroImageSize");
- if (max_value >= 4294967295)
+ if (max_value > 4294967295)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
for (depth=1; GetQuantumRange(depth) < max_value; depth++) ;
image->depth=depth;
}
case '3':
{
- PixelInfo
- pixel;
-
/*
Convert PNM image to pixel packets.
*/
Convert image to a PGM image.
*/
if (image->depth > 32)
- image->depth=16;
+ image->depth=32;
(void) FormatLocaleString(buffer,MaxTextExtent,"%.20g\n",(double)
((MagickOffsetType) GetQuantumRange(image->depth)));
(void) WriteBlobString(image,buffer);
if (image->depth == 8)
pixel=ScaleQuantumToChar(GetPixelRed(image,p));
else
- pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelRed(image,p),
+ max_value);
}
q=PopCharPixel((unsigned char) pixel,q);
p+=GetPixelChannels(image);
for (x=0; x < (ssize_t) image->columns; x++)
{
if (IsPixelGray(image,p) == MagickFalse)
- pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
- image,p)),max_value);
+ pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,
+ p)),max_value);
else
{
if (image->depth == 16)
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
else
- pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelRed(image,p),
+ max_value);
}
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
p+=GetPixelChannels(image);
for (x=0; x < (ssize_t) image->columns; x++)
{
if (IsPixelGray(image,p) == MagickFalse)
- pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
- image,p)),max_value);
+ pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,p)),
+ max_value);
else
{
if (image->depth == 16)
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,p)),
- max_value);
+ pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,
+ p)),max_value);
q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
{
pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
q=PopCharPixel((unsigned char) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelGreen(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelGreen(image,p),
+ max_value);
q=PopCharPixel((unsigned char) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
+ max_value);
q=PopCharPixel((unsigned char) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlack(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
+ max_value);
q=PopCharPixel((unsigned char) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
{
pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelGreen(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelGreen(image,p),
+ max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
+ max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlack(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
+ max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
- pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
+ max_value);
q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
}
p+=GetPixelChannels(image);
{
pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
q=PopCharPixel((unsigned char) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelGreen(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelGreen(image,p),
+ max_value);
q=PopCharPixel((unsigned char) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
+ max_value);
q=PopCharPixel((unsigned char) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
{
pixel=ScaleQuantumToAny(GetPixelRed(image,p),max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelGreen(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelGreen(image,p),
+ max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
- pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
+ max_value);
q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
if (image->alpha_trait == BlendPixelTrait)
{
- pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),max_value);
+ pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
+ max_value);
q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
}
p+=GetPixelChannels(image);