% July 1992 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 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 %
*canvas_image,
*image;
- ssize_t
- y;
-
MagickBooleanType
status;
i;
ssize_t
- count;
+ count,
+ y;
size_t
length;
image=DestroyImageList(image);
return((Image *) NULL);
}
- for (i=0; i < image->offset; i++)
- if (ReadBlobByte(image) == EOF)
- {
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
- break;
- }
+ if (DiscardBlobBytes(image,image->offset) == MagickFalse)
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
}
/*
Create virtual canvas to support cropping (i.e. image.cmyk[100x100+10+20]).
register IndexPacket
*restrict indexes;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register IndexPacket
*restrict indexes;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register IndexPacket
*restrict indexes;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
image=DestroyImageList(image);
return((Image *) NULL);
}
- for (i=0; i < image->offset; i++)
- if (ReadBlobByte(image) == EOF)
- {
- ThrowFileException(exception,CorruptImageError,
- "UnexpectedEndOfFile",image->filename);
- break;
- }
+ if (DiscardBlobBytes(image,image->offset) == MagickFalse)
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register IndexPacket
*restrict indexes;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
register const PixelPacket
*restrict p;
- register ssize_t
- x;
-
register PixelPacket
*restrict q;
+ register ssize_t
+ x;
+
if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
static MagickBooleanType WriteCMYKImage(const ImageInfo *image_info,
Image *image)
{
- ssize_t
- y;
-
MagickBooleanType
status;
quantum_type;
ssize_t
- count;
+ count,
+ y;
size_t
length;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- quantum_type,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,quantum_type,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- CyanQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,CyanQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- MagentaQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,MagentaQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- YellowQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,YellowQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- BlackQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,BlackQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- CyanQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,CyanQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- MagentaQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,MagentaQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- YellowQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,YellowQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- BlackQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,BlackQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
register const PixelPacket
*restrict p;
- p=GetVirtualPixels(image,0,y,image->columns,1,
- &image->exception);
+ p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
length=ExportQuantumPixels(image,(const CacheView *) NULL,
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- CyanQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,CyanQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- MagentaQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,MagentaQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- YellowQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,YellowQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
- length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
- BlackQuantum,pixels,&image->exception);
+ length=ExportQuantumPixels(image,(const CacheView *) NULL,
+ quantum_info,BlackQuantum,pixels,&image->exception);
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;