% July 1992 %
% %
% %
-% Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2018 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 %
% obtain a copy of the License at %
% %
-% http://www.imagemagick.org/script/license.php %
+% https://www.imagemagick.org/script/license.php %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
MagickBooleanType
status;
+ MemoryInfo
+ *pixel_info;
+
register Quantum
*q;
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
image->columns=width;
image->rows=height;
image->depth=8;
+ image->alpha_trait=BlendPixelTrait;
if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
if (image->scene >= (image_info->scene+image_info->number_scenes-1))
break;
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
return(DestroyImageList(image));
- pixels=(unsigned char *) AcquireQuantumMemory(image->columns,
- 4*sizeof(*pixels));
- if (pixels == (unsigned char *) NULL)
+ pixel_info=AcquireVirtualMemory(image->columns,4*sizeof(*pixels));
+ if (pixel_info == (MemoryInfo *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info);
length=(size_t) 4*image->columns;
for (y=0; y < (ssize_t) image->rows; y++)
{
count=ReadBlob(image,length,pixels);
if ((size_t) count != length)
- ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+ {
+ pixel_info=RelinquishVirtualMemory(pixel_info);
+ ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+ }
p=pixels;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
SetPixelRed(image,ScaleCharToQuantum(*p++),q);
SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
- if (GetPixelAlpha(image,q) != OpaqueAlpha)
- image->alpha_trait=BlendPixelTrait;
q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}
}
- pixels=(unsigned char *) RelinquishMagickMemory(pixels);
+ pixel_info=RelinquishVirtualMemory(pixel_info);
if (EOFBlob(image) != MagickFalse)
{
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
MagickOffsetType
scene;
+ MemoryInfo
+ *pixel_info;
+
register const Quantum
- *restrict p;
+ *magick_restrict p;
register ssize_t
x;
register unsigned char
- *restrict q;
+ *magick_restrict q;
ssize_t
count,
Open output image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
/*
Allocate memory for pixels.
*/
- pixels=(unsigned char *) AcquireQuantumMemory(image->columns,
- 4*sizeof(*pixels));
- if (pixels == (unsigned char *) NULL)
+ pixel_info=AcquireVirtualMemory(image->columns,4*sizeof(*pixels));
+ if (pixel_info == (MemoryInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info);
/*
Convert MIFF to AVS raster pixels.
*/
break;
}
}
- pixels=(unsigned char *) RelinquishMagickMemory(pixels);
+ pixel_info=RelinquishVirtualMemory(pixel_info);
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);