% o length: the number of bytes to skip.
%
*/
-
-static inline const unsigned char *ReadBlobStream(Image *image,
- const size_t length,unsigned char *data,ssize_t *count)
-{
- assert(count != (ssize_t *) NULL);
- assert(image->blob != (BlobInfo *) NULL);
- if (image->blob->type != BlobStream)
- {
- *count=ReadBlob(image,length,data);
- return(data);
- }
- if (image->blob->offset >= (MagickOffsetType) image->blob->length)
- {
- *count=0;
- image->blob->eof=MagickTrue;
- return(data);
- }
- data=image->blob->data+image->blob->offset;
- *count=(ssize_t) MagickMin((MagickOffsetType) length,image->blob->length-
- image->blob->offset);
- image->blob->offset+=(*count);
- if (*count != (ssize_t) length)
- image->blob->eof=MagickTrue;
- return(data);
-}
-
MagickExport MagickBooleanType DiscardBlobBytes(Image *image,
const MagickSizeType length)
{
% %
% %
% %
++ R e a d B l o b S t r e a m %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% ReadBlobStream() reads data from the blob or image file and returns it. It
+% returns a pointer to the data buffer you supply or to the image memory
+% buffer if its supported (zero-copy). If length is zero, ReadBlobStream()
+% returns a count of zero and has no other results. If length is greater than
+% SSIZE_MAX, the result is unspecified.
+%
+% The format of the ReadBlobStream method is:
+%
+% const void *ReadBlobStream(Image *image,const size_t length,void *data,
+% ssize_t *count)
+%
+% A description of each parameter follows:
+%
+% o image: the image.
+%
+% o length: Specifies an integer representing the number of bytes to read
+% from the file.
+%
+% o count: returns the number of bytes read.
+%
+% o data: Specifies an area to place the information requested from the
+% file.
+%
+*/
+MagickExport const void *ReadBlobStream(Image *image,const size_t length,
+ void *data,ssize_t *count)
+{
+ assert(image != (Image *) NULL);
+ assert(image->signature == MagickSignature);
+ assert(image->blob != (BlobInfo *) NULL);
+ assert(image->blob->type != UndefinedStream);
+ assert(count != (ssize_t *) NULL);
+ if (image->blob->type != BlobStream)
+ {
+ assert(data != NULL);
+ *count=ReadBlob(image,length,data);
+ return(data);
+ }
+ if (image->blob->offset >= (MagickOffsetType) image->blob->length)
+ {
+ *count=0;
+ image->blob->eof=MagickTrue;
+ return(data);
+ }
+ data=image->blob->data+image->blob->offset;
+ *count=(ssize_t) MagickMin((MagickOffsetType) length,image->blob->length-
+ image->blob->offset);
+ image->blob->offset+=(*count);
+ if (*count != (ssize_t) length)
+ image->blob->eof=MagickTrue;
+ return(data);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+ R e a d B l o b S t r i n g %
% %
% %
assert(string != (const char *) NULL);
return(WriteBlobStream(image,strlen(string),(const unsigned char *) string));
}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
-+ Z e r o C o p y R e a d B l o b %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ZeroCopyReadBlob() reads data from the blob or image file and returns it. It
-% returns a pointer to the data buffer you supply or to the image memory
-% buffer if its supported (zero-copy). If length is zero, ZeroCopyReadBlob()
-% returns a count of zero and has no other results. If length is greater than
-% SSIZE_MAX, the result is unspecified.
-%
-% The format of the ZeroReadBlobCopy method is:
-%
-% void *ZeroCopyReadBlob(Image *image,const size_t length,ssize_t *count,
-% void *data)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-% o length: Specifies an integer representing the number of bytes to read
-% from the file.
-%
-% o length: returns the number of bytes read.
-%
-% o data: Specifies an area to place the information requested from the
-% file.
-%
-*/
-MagickExport void *ZeroCopyReadBlob(Image *image,const size_t length,void *data,
- ssize_t *count)
-{
- *count=ReadBlob(image,length,data);
- return(data);
-}
extern MagickExport char
*ReadBlobString(Image *,char *);
+extern MagickExport const void
+ *ReadBlobStream(Image *,const size_t,void *,ssize_t *);
+
extern MagickExport double
ReadBlobDouble(Image *);
*ImagesToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *),
*MapBlob(int,const MapMode,const MagickOffsetType,const size_t),
MSBOrderLong(unsigned char *,const size_t),
- MSBOrderShort(unsigned char *,const size_t),
- *ZeroCopyReadBlob(Image *,const size_t,void *,ssize_t *);
+ MSBOrderShort(unsigned char *,const size_t);
#if defined(__cplusplus) || defined(c_plusplus)
}
%
% The format of the GetQuantumPixels method is:
%
-% unsigned char *QuantumPixels GetQuantumPixels(
-% const QuantumInfo *quantum_info)
+% void *QuantumPixels GetQuantumPixels(const QuantumInfo *quantum_info)
%
% A description of each parameter follows:
%
% o image: the image.
%
*/
-MagickExport unsigned char *GetQuantumPixels(const QuantumInfo *quantum_info)
+MagickExport void *GetQuantumPixels(const QuantumInfo *quantum_info)
{
const int
id = GetOpenMPThreadId();
ImportQuantumPixels(const Image *,CacheView *,QuantumInfo *,const QuantumType,
const unsigned char *,ExceptionInfo *);
-extern MagickExport unsigned char
- *GetQuantumPixels(const QuantumInfo *);
-
extern MagickExport void
GetQuantumInfo(const ImageInfo *,QuantumInfo *),
+ *GetQuantumPixels(const QuantumInfo *),
SetQuantumAlphaType(QuantumInfo *,const QuantumAlphaType),
SetQuantumImageType(Image *,const QuantumType),
SetQuantumMinIsWhite(QuantumInfo *,const MagickBooleanType),
*/
static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
length=GetQuantumExtent(image,quantum_info,GrayQuantum);
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
GrayQuantum,pixels,exception);
- count=ReadBlob(image,(size_t) (-(ssize_t) length) & 0x01,pixels);
+ pixels=ReadBlobStream(image,(size_t) (-(ssize_t) length) & 0x01,
+ GetQuantumPixels(quantum_info),&count);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse)
static Image *ReadBGRImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
quantum_type=BGRQuantum;
if (LocaleCompare(image_info->magick,"BGRA") == 0)
{
quantum_type=BGRAQuantum;
image->alpha_trait=BlendPixelTrait;
}
+ pixels=NULL;
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,BlueQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,GreenQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,AlphaQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
CINInfo
cin;
+ const void
+ *pixels;
+
Image
*image;
y;
unsigned char
- magick[4],
- *pixels;
+ magick[4];
/*
Open image file.
quantum_info->quantum=32;
quantum_info->pack=MagickFalse;
quantum_type=RGBQuantum;
- pixels=GetQuantumPixels(quantum_info);
length=GetQuantumExtent(image,quantum_info,quantum_type);
length=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
if (cin.image.number_channels == 1)
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if ((size_t) count != length)
break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
static Image *ReadCMYKImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
quantum_type=CMYKQuantum;
if (LocaleCompare(image_info->magick,"CMYKA") == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,CyanQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
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++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,MagentaQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
canvas_image->columns,1,exception);
q=GetAuthenticPixels(image,0,y-image->extract_info.y,
image->columns,1,exception);
- if ((p == (const Quantum *) NULL) ||
- (q == (Quantum *) NULL))
+ if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,YellowQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,BlackQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,AlphaQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
MagickTrue : MagickFalse);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
count,
offset;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType) row,
- image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType) row,
+ image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
image->columns*fpx_info.components[i].columnStride;
fpx_info.components[i].theData=pixels+i;
}
- fpx_info.components[0].myColorType.myColor=fpx_info.numberOfComponents != 1
- ? NIFRGB_R : MONOCHROME;
+ fpx_info.components[0].myColorType.myColor=fpx_info.numberOfComponents != 1 ?
+ NIFRGB_R : MONOCHROME;
fpx_info.components[1].myColorType.myColor=NIFRGB_G;
fpx_info.components[2].myColorType.myColor=NIFRGB_B;
fpx_info.components[3].myColorType.myColor=ALPHA;
/*
- Write image pixelss.
+ Write image pixels.
*/
quantum_type=RGBQuantum;
if (image->alpha_trait != UndefinedPixelTrait)
static Image *ReadGRAYImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
SetQuantumImageType(image,quantum_type);
/*
extent=GetQuantumExtent(image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
size_t
length;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
- row,image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,extent,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
+ row,image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
count,
offset;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
- row,image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,extent,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
+ row,image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
(void) SetQuantumEndian(image,quantum_info,MSBEndian);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
count,
offset;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
- row,image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,extent,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
+ row,image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
count,
offset;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
- row,image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,extent,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
+ row,image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
for (x=0; x < (ssize_t) image->columns; x++)
{
p=PushCharPixel(p,&pixel);
- SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
SetPixelAlpha(image,OpaqueAlpha,q);
if (image->alpha_trait != UndefinedPixelTrait)
{
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&pixel);
- SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
}
q+=GetPixelChannels(image);
}
p=PushCharPixel(p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,max_value),q);
p=PushCharPixel(p,&pixel);
- SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushCharPixel(p,&pixel);
- SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushCharPixel(p,&pixel);
- SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
SetPixelAlpha(image,OpaqueAlpha,q);
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,max_value),q);
p=PushShortPixel(MSBEndian,p,&pixel);
- SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushShortPixel(MSBEndian,p,&pixel);
- SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushShortPixel(MSBEndian,p,&pixel);
- SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
SetPixelAlpha(image,OpaqueAlpha,q);
if (image->alpha_trait != UndefinedPixelTrait)
{
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&pixel);
- SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
}
q+=GetPixelChannels(image);
}
p=PushCharPixel(p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,max_value),q);
p=PushCharPixel(p,&pixel);
- SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushCharPixel(p,&pixel);
- SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
SetPixelAlpha(image,OpaqueAlpha,q);
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushCharPixel(p,&pixel);
- SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
+ max_value),q);
}
q+=GetPixelChannels(image);
}
p=PushShortPixel(MSBEndian,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,max_value),q);
p=PushShortPixel(MSBEndian,p,&pixel);
- SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelGreen(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
p=PushShortPixel(MSBEndian,p,&pixel);
- SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
SetPixelAlpha(image,OpaqueAlpha,q);
if (image->alpha_trait != UndefinedPixelTrait)
{
if (image->alpha_trait != UndefinedPixelTrait)
{
p=PushLongPixel(MSBEndian,p,&pixel);
- SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
+ SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),
+ q);
}
q+=GetPixelChannels(image);
}
extent=GetQuantumExtent(image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
+ const void
+ *pixels;
+
MagickBooleanType
sync;
size_t
length;
- unsigned char
- *pixels;
-
if (status == MagickFalse)
continue;
- pixels=GetQuantumPixels(quantum_info);
- {
- count=ReadBlob(image,extent,pixels);
- if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
- (image->previous == (Image *) NULL))
- {
- MagickBooleanType
- proceed;
-
- proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
- row,image->rows);
- if (proceed == MagickFalse)
- status=MagickFalse;
- }
- offset=row++;
- }
+ pixels=ReadBlobStream(image,extent,GetQuantumPixels(quantum_info),
+ &count);
if ((size_t) count != extent)
status=MagickFalse;
+ if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
+ (image->previous == (Image *) NULL))
+ {
+ MagickBooleanType
+ proceed;
+
+ proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType)
+ row,image->rows);
+ if (proceed == MagickFalse)
+ status=MagickFalse;
+ }
+ offset=row++;
q=QueueAuthenticPixels(image,0,(ssize_t) (image->rows-offset-1),
image->columns,1,exception);
if (q == (Quantum *) NULL)
*/
static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
if (image_info->number_scenes != 0)
while (image->scene < image_info->scene)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
SetQuantumImageType(image,quantum_type);
/*
*/
static Image *ReadRGBImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
quantum_type=RGBQuantum;
if (LocaleCompare(image_info->magick,"RGBA") == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,GreenQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,BlueQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,AlphaQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
register const Quantum
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
keyword[MaxTextExtent],
value[MaxTextExtent];
+ const void
+ *pixels;
+
Image
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
length=GetQuantumExtent(image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
+ break;
(void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
static Image *ReadYCBCRImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
+ const void
+ *pixels;
+
Image
*canvas_image,
*image;
count,
y;
- unsigned char
- *pixels;
-
/*
Open image file.
*/
quantum_info=AcquireQuantumInfo(image_info,canvas_image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
quantum_type=RGBQuantum;
if (LocaleCompare(image_info->magick,"YCbCrA") == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
for (y=0; y < (ssize_t) image->rows; y++)
{
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
if (count != (ssize_t) length)
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (status == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
break;
}
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (scene == 0)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,RedQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,GreenQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,BlueQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{
length=GetQuantumExtent(canvas_image,quantum_info,AlphaQuantum);
for (i=0; i < (ssize_t) scene; i++)
for (y=0; y < (ssize_t) image->extract_info.height; y++)
- if (ReadBlob(image,length,pixels) != (ssize_t) length)
+ {
+ pixels=ReadBlobStream(image,length,
+ GetQuantumPixels(quantum_info),&count);
+ if (count != (ssize_t) length)
{
ThrowFileException(exception,CorruptImageError,
"UnexpectedEndOfFile",image->filename);
break;
}
- count=ReadBlob(image,length,pixels);
+ }
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
for (y=0; y < (ssize_t) image->extract_info.height; y++)
{
if (count != (ssize_t) length)
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
- count=ReadBlob(image,length,pixels);
+ pixels=ReadBlobStream(image,length,GetQuantumPixels(quantum_info),
+ &count);
}
if (image->previous == (Image *) NULL)
{