% July 1992 %
% %
% %
-% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2017 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, %
Initialize Image structure.
*/
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);
read_info=CloneImageInfo(image_info);
SetImageInfoBlob(read_info,(void *) NULL,0);
- *read_info->magick='\0';
+ (void) CopyMagickString(read_info->magick,"MIFF",MagickPathExtent);
image=ReadImage(read_info,exception);
read_info=DestroyImageInfo(read_info);
if (image != (Image *) NULL)
MagickInfo
*entry;
- entry=SetMagickInfo("MASK");
+ entry=AcquireMagickInfo("MASK","MASK","Image Clip Mask");
entry->decoder=(DecodeImageHandler *) ReadMASKImage;
entry->encoder=(EncodeImageHandler *) WriteMASKImage;
- entry->description=ConstantString("Image Clip Mask");
- entry->module=ConstantString("MASK");
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
- *restrict p;
+ *magick_restrict p;
register Quantum
- *restrict q;
+ *magick_restrict q;
register ssize_t
x;
for (x=0; x < (ssize_t) image->columns; x++)
{
SetPixelChannel(mask_image,GrayPixelChannel,0,q);
- SetPixelChannel(mask_image,GrayPixelChannel,GetPixelReadMask(image,p),q);
+ SetPixelChannel(mask_image,GrayPixelChannel,GetPixelWriteMask(image,p),q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(mask_image);
}
mask_image=MaskImage(image,exception);
if (mask_image == (Image *) NULL)
return(MagickFalse);
- (void) CopyMagickString(mask_image->filename,image->filename,MaxTextExtent);
+ (void) CopyMagickString(mask_image->filename,image->filename,
+ MagickPathExtent);
write_info=CloneImageInfo(image_info);
+ *write_info->magick='\0';
(void) SetImageInfo(write_info,1,exception);
- if (LocaleCompare(write_info->magick,"MASK") == 0)
- (void) FormatLocaleString(mask_image->filename,MaxTextExtent,"miff:%s",
+ if ((*write_info->magick == '\0') ||
+ (LocaleCompare(write_info->magick,"MASK") == 0))
+ (void) FormatLocaleString(mask_image->filename,MagickPathExtent,"miff:%s",
write_info->filename);
status=WriteImage(write_info,mask_image,exception);
mask_image=DestroyImage(mask_image);