diff options
author | hj kim <backto.kim@samsung.com> | 2022-12-02 18:03:33 +0900 |
---|---|---|
committer | hj kim <backto.kim@samsung.com> | 2022-12-02 18:05:37 +0900 |
commit | 043c171f3b5935329641967057ae5f45bc1a5631 (patch) | |
tree | 3790114f5381a956636ebd4902e06fc67ea03846 /magick | |
parent | cdc6b7097f011782b30d005f812fb288fd367f34 (diff) | |
download | GraphicsMagick-043c171f3b5935329641967057ae5f45bc1a5631.tar.gz GraphicsMagick-043c171f3b5935329641967057ae5f45bc1a5631.tar.bz2 GraphicsMagick-043c171f3b5935329641967057ae5f45bc1a5631.zip |
Imported Upstream version 1.3.38upstream/1.3.38
Change-Id: Ifa84f803e2a49df09eaabc07cea004c5071572b3
Diffstat (limited to 'magick')
52 files changed, 2057 insertions, 1222 deletions
diff --git a/magick/analyze.c b/magick/analyze.c index 938d0fb..1d18ece 100644 --- a/magick/analyze.c +++ b/magick/analyze.c @@ -17,6 +17,7 @@ #include "magick/studio.h" #include "magick/analyze.h" #include "magick/color.h" +#include "magick/log.h" #include "magick/monitor.h" #include "magick/pixel_cache.h" #include "magick/pixel_iterator.h" @@ -252,6 +253,10 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image, bounds.x=0; bounds.y=0; } + if (image->logging) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Bounding Box: %lux%lu%+ld%+ld", + bounds.width, bounds.height, bounds.x, bounds.y); return(bounds); } diff --git a/magick/annotate.c b/magick/annotate.c index 6dce70f..4108175 100644 --- a/magick/annotate.c +++ b/magick/annotate.c @@ -780,7 +780,7 @@ char const *FindCommaDelimitedName for ( pEnd = pStart + 1; (c = *pEnd) && (c != ','); pEnd++ ); /*find terminating comma*/ pNextSearchStart = pEnd; - for ( ; isspace(pEnd[-1]); pEnd-- ); /*trim trailing space; we know there is a non-space character there*/ + for ( ; isspace((int) pEnd[-1]); pEnd-- ); /*trim trailing space; we know there is a non-space character there*/ /* trim off surrounding single quotes */ if ((*pStart == '\'') && (*pEnd == '\'') && ((pEnd-pStart) >= 3)) diff --git a/magick/attribute.c b/magick/attribute.c index 791a7d9..40f47a2 100644 --- a/magick/attribute.c +++ b/magick/attribute.c @@ -798,8 +798,8 @@ TraceSVGClippingPath(unsigned char *blob, { y=ReadMSBLong(&blob,&length); x=ReadMSBLong(&blob,&length); - point[i].x=(double) x*columns/4096/4096; - point[i].y=(double) y*rows/4096/4096; + point[i].x=(double) x*columns/4096.0/4096.0; + point[i].y=(double) y*rows/4096.0/4096.0; } if (!in_subpath) { diff --git a/magick/blob.c b/magick/blob.c index 2216516..68c05a8 100644 --- a/magick/blob.c +++ b/magick/blob.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2018 GraphicsMagick Group +% Copyright (C) 2003 - 2022 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -100,6 +100,10 @@ typedef union _MagickFileHandle struct _BlobInfo { + magick_uint64_t + read_limit, /* Limit on data to return to API user */ + read_total; /* Amount of data read thus far */ + size_t block_size, /* I/O block size */ length, /* The current size of the BLOB data. */ @@ -269,10 +273,22 @@ static inline size_t ReadBlobStream(Image *image,const size_t length, return 0; } *data=(void *)(blob->data+blob->offset); - available=Min(length,blob->length-blob->offset); + available=Min(Min(length,blob->read_limit-blob->read_total), + (size_t)(blob->length-blob->offset)); blob->offset+=available; + blob->read_total += available; if (available < length) - blob->eof=True; + { + if (MagickFalse == blob->eof) + { + blob->eof=MagickTrue; + if (blob->read_limit <= blob->read_total) + { + ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded, + image->filename); + } + } + } return available; } @@ -1318,38 +1334,41 @@ MagickExport int EOFBlob(const Image *image) assert(image->blob != (BlobInfo *) NULL); assert(image->blob->type != UndefinedStream); blob=image->blob; - switch (blob->type) - { - case UndefinedStream: - break; - case FileStream: - case StandardStream: - case PipeStream: - { - blob->eof=feof(blob->handle.std); - break; - } - case ZipStream: + if (!blob->eof) { + switch (blob->type) + { + case UndefinedStream: + break; + case FileStream: + case StandardStream: + case PipeStream: + { + blob->eof=feof(blob->handle.std); + break; + } + case ZipStream: + { #if defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) - blob->eof=gzeof(blob->handle.gz); + blob->eof=gzeof(blob->handle.gz); #endif /* defined(HasZLIB) && !defined(DISABLE_COMPRESSED_FILES) */ - break; - } - case BZipStream: - { + break; + } + case BZipStream: + { #if defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) - int - status; + int + status; - (void) BZ2_bzerror(blob->handle.bz,&status); - blob->eof=status == BZ_UNEXPECTED_EOF; + (void) BZ2_bzerror(blob->handle.bz,&status); + blob->eof=status == BZ_UNEXPECTED_EOF; #endif /* defined(HasBZLIB) && !defined(DISABLE_COMPRESSED_FILES) */ - break; + break; + } + case BlobStream: + break; + } } - case BlobStream: - break; - } return(blob->eof); } @@ -2238,6 +2257,7 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info,Image *image, { /* Native blob support for this image format. + FIXME: This results in a memory leak if the blob is not opened. */ clone_info->blob=MagickAllocateMemory(void *,65535L); if (clone_info->blob == (void *) NULL) @@ -2258,7 +2278,7 @@ MagickExport void *ImageToBlob(const ImageInfo *image_info,Image *image, *image->filename='\0'; /* Write the image to the blob */ status=WriteImage(clone_info,image); - if (status == MagickFalse) + if (status == MagickFail) { /* Only assert our own exception if an exception was not already reported. */ if (image->exception.severity == UndefinedException) @@ -2386,7 +2406,8 @@ MagickExport MagickPassFail ImageToFile(Image *image,const char *filename, size_t block_size, - length; + length, + total=0; assert(image != (Image *) NULL); assert(image->signature == MagickSignature); @@ -2420,6 +2441,7 @@ MagickExport MagickPassFail ImageToFile(Image *image,const char *filename, count=write(file,buffer+i,(MAGICK_POSIX_IO_SIZE_T) (length-i)); if (count <= 0) break; + total += count; } if (i < length) break; @@ -2427,7 +2449,8 @@ MagickExport MagickPassFail ImageToFile(Image *image,const char *filename, (void) close(file); if (image->logging) (void) LogMagickEvent(BlobEvent,GetMagickModule(), - "Copyied %"MAGICK_SIZE_T_F"u bytes from Blob stream to \"%s\"",(MAGICK_SIZE_T) i,filename); + "Copied %"MAGICK_SIZE_T_F"u bytes from Blob stream to \"%s\"", + (MAGICK_SIZE_T) total,filename); MagickFreeMemory(buffer); return (i < length ? MagickFail : MagickPass); } @@ -2710,6 +2733,11 @@ MagickExport MagickPassFail OpenBlob(const ImageInfo *image_info,Image *image, " mode %s ...", image, image->blob, BlobModeToString(mode)); /* + Set read limits + */ + image->blob->read_limit = (magick_uint64_t) GetMagickResourceLimit(ReadResource); + image->blob->read_total = 0; + /* Cache I/O block size */ image->blob->block_size=MagickGetFileSystemBlockSize(); @@ -3151,13 +3179,14 @@ MagickExport Image *PingBlob(const ImageInfo *image_info,const void *blob, % % */ -MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) +MagickExport size_t ReadBlob(Image *image,const size_t req_length,void *data) { BlobInfo * restrict blob; size_t - count; + count, + length; assert(image != (Image *) NULL); assert(image->signature == MagickSignature); @@ -3166,6 +3195,9 @@ MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) assert(data != (void *) NULL); blob=image->blob; + + length=Min(req_length,blob->read_limit-blob->read_total); + count=0; switch (blob->type) { @@ -3187,6 +3219,7 @@ MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) } else { + *((unsigned char *)data)=0; count=0; } } @@ -3334,6 +3367,19 @@ MagickExport size_t ReadBlob(Image *image,const size_t length,void *data) } } assert(count <= length); + blob->read_total += count; + if (count < req_length) + { + if (MagickFalse == blob->eof) + { + blob->eof=MagickTrue; + if (blob->read_limit <= blob->read_total) + { + ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded, + image->filename); + } + } + } return(count); } @@ -3432,6 +3478,14 @@ MagickExport int ReadBlobByte(Image *image) blob=image->blob; + if (blob->read_total >= blob->read_limit) + { + blob->eof=1; + ThrowException(&image->exception,ResourceLimitError,ReadLimitExceeded, + image->filename); + return EOF; + } + switch (blob->type) { case FileStream: @@ -3447,6 +3501,10 @@ MagickExport int ReadBlobByte(Image *image) blob->first_errno=errno; } } + else + { + blob->read_total++; + } break; } case BlobStream: @@ -3455,6 +3513,7 @@ MagickExport int ReadBlobByte(Image *image) { octet=*((unsigned char *)blob->data+blob->offset); blob->offset++; + blob->read_total++; c=octet; } else @@ -3470,6 +3529,7 @@ MagickExport int ReadBlobByte(Image *image) c=octet; } } + return c; } @@ -5039,7 +5099,7 @@ MagickExport size_t WriteBlob(Image *image,const size_t length,const void *data) else amount=(int) remaining; - bz_count=BZ2_bzwrite(blob->handle.gz, + bz_count=BZ2_bzwrite(blob->handle.bz, (void *) ((unsigned char *) data+i),amount); if (bz_count <= 0) break; diff --git a/magick/colorspace.c b/magick/colorspace.c index 4c8bb15..40cd2ee 100644 --- a/magick/colorspace.c +++ b/magick/colorspace.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2019 GraphicsMagick Group +% Copyright (C) 2003 - 2021 GraphicsMagick Group % Copyright (C) 2003 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -674,27 +674,27 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, xform.primary_info.z=(ScaleCharToMap(137)); for (i=0; i <= (long) (0.018*MaxMap); i++) { - xform.x[i].x=(0.003962014134275617*i); - xform.x[i].y=((-0.002426619775463276)*i); - xform.x[i].z=(0.006927257754597858*i); - xform.y[i].x=(0.007778268551236748*i); - xform.y[i].y=((-0.004763965913702149)*i); - xform.y[i].z=((-0.005800713697502058)*i); - xform.z[i].x=(0.001510600706713781*i); - xform.z[i].y=(0.007190585689165425*i); - xform.z[i].z=((-0.0011265440570958)*i); + xform.x[i].x=(float) (0.003962014134275617*i); + xform.x[i].y=(float) ((-0.002426619775463276)*i); + xform.x[i].z=(float) (0.006927257754597858*i); + xform.y[i].x=(float) (0.007778268551236748*i); + xform.y[i].y=(float) ((-0.004763965913702149)*i); + xform.y[i].z=(float) ((-0.005800713697502058)*i); + xform.z[i].x=(float) (0.001510600706713781*i); + xform.z[i].y=(float) (0.007190585689165425*i); + xform.z[i].z=(float) ((-0.0011265440570958)*i); } for ( ; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.2201118963486454*(1.099*i-0.099)); - xform.x[i].y=((-0.1348122097479598)*(1.099*i-0.099)); - xform.x[i].z=(0.3848476530332144*(1.099*i-0.099)); - xform.y[i].x=(0.4321260306242638*(1.099*i-0.099)); - xform.y[i].y=((-0.2646647729834528)*(1.099*i-0.099)); - xform.y[i].z=((-0.3222618720834477)*(1.099*i-0.099)); - xform.z[i].x=(0.08392226148409894*(1.099*i-0.099)); - xform.z[i].y=(0.3994769827314126*(1.099*i-0.099)); - xform.z[i].z=((-0.06258578094976668)*(1.099*i-0.099)); + xform.x[i].x=(float) (0.2201118963486454*(1.099*i-0.099)); + xform.x[i].y=(float) ((-0.1348122097479598)*(1.099*i-0.099)); + xform.x[i].z=(float) (0.3848476530332144*(1.099*i-0.099)); + xform.y[i].x=(float) (0.4321260306242638*(1.099*i-0.099)); + xform.y[i].y=(float) ((-0.2646647729834528)*(1.099*i-0.099)); + xform.y[i].z=(float) ((-0.3222618720834477)*(1.099*i-0.099)); + xform.z[i].x=(float) (0.08392226148409894*(1.099*i-0.099)); + xform.z[i].y=(float) (0.3994769827314126*(1.099*i-0.099)); + xform.z[i].z=(float) ((-0.06258578094976668)*(1.099*i-0.099)); } break; } @@ -714,15 +714,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.412453f*(float) i); - xform.x[i].y=(0.212671f*(float) i); - xform.x[i].z=(0.019334f*(float) i); - xform.y[i].x=(0.35758f*(float) i); - xform.y[i].y=(0.71516f*(float) i); - xform.y[i].z=(0.119193f*(float) i); - xform.z[i].x=(0.180423f*(float) i); - xform.z[i].y=(0.072169f*(float) i); - xform.z[i].z=(0.950227f*(float) i); + xform.x[i].x=(float) (0.412453f*(float) i); + xform.x[i].y=(float) (0.212671f*(float) i); + xform.x[i].z=(float) (0.019334f*(float) i); + xform.y[i].x=(float) (0.35758f*(float) i); + xform.y[i].y=(float) (0.71516f*(float) i); + xform.y[i].z=(float) (0.119193f*(float) i); + xform.z[i].x=(float) (0.180423f*(float) i); + xform.z[i].y=(float) (0.072169f*(float) i); + xform.z[i].z=(float) (0.950227f*(float) i); } break; } @@ -747,15 +747,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.299f*(float) i); /* Red */ - xform.x[i].y=((-0.16873f)*(float) i); /* Green */ - xform.x[i].z=(0.500000f*(float) i); /* Blue */ - xform.y[i].x=(0.587f*(float) i); /* Red */ - xform.y[i].y=((-0.331264f)*(float) i); /* Green */ - xform.y[i].z=((-0.418688f)*(float) i); /* Blue */ - xform.z[i].x=(0.114f*(float) i); /* Red */ - xform.z[i].y=(0.500000f*(float) i); /* Green */ - xform.z[i].z=((-0.081312f)*(float) i); /* Blue */ + xform.x[i].x=(float) (0.299f*(float) i); /* Red */ + xform.x[i].y=(float) ((-0.16873f)*(float) i); /* Green */ + xform.x[i].z=(float) (0.500000f*(float) i); /* Blue */ + xform.y[i].x=(float) (0.587f*(float) i); /* Red */ + xform.y[i].y=(float) ((-0.331264f)*(float) i); /* Green */ + xform.y[i].z=(float) ((-0.418688f)*(float) i); /* Blue */ + xform.z[i].x=(float) (0.114f*(float) i); /* Red */ + xform.z[i].y=(float) (0.500000f*(float) i); /* Green */ + xform.z[i].z=(float) ((-0.081312f)*(float) i); /* Blue */ } break; } @@ -780,15 +780,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.212600f*(float) i); /* Red */ - xform.x[i].y=((-0.114572f)*(float) i); /* Green */ - xform.x[i].z=(0.500000f*(float) i); /* Blue */ - xform.y[i].x=(0.715200f*(float) i); /* Red */ - xform.y[i].y=((-0.385428f)*(float) i); /* Green */ - xform.y[i].z=((-0.454153f)*(float) i); /* Blue */ - xform.z[i].x=(0.072200f*(float) i); /* Red */ - xform.z[i].y=(0.500000f*(float) i); /* Green */ - xform.z[i].z=((-0.045847f)*(float) i); /* Blue */ + xform.x[i].x=(float) (0.212600f*(float) i); /* Red */ + xform.x[i].y=(float) ((-0.114572f)*(float) i); /* Green */ + xform.x[i].z=(float) (0.500000f*(float) i); /* Blue */ + xform.y[i].x=(float) (0.715200f*(float) i); /* Red */ + xform.y[i].y=(float) ((-0.385428f)*(float) i); /* Green */ + xform.y[i].z=(float) ((-0.454153f)*(float) i); /* Blue */ + xform.z[i].x=(float) (0.072200f*(float) i); /* Red */ + xform.z[i].y=(float) (0.500000f*(float) i); /* Green */ + xform.z[i].z=(float) ((-0.045847f)*(float) i); /* Blue */ } break; } @@ -811,27 +811,27 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, xform.primary_info.z=(ScaleCharToMap(137)); for (i=0; i <= (long) (0.018*MaxMap); i++) { - xform.x[i].x=(0.003962014134275617*i); - xform.x[i].y=((-0.002426619775463276)*i); - xform.x[i].z=(0.006927257754597858*i); - xform.y[i].x=(0.007778268551236748*i); - xform.y[i].y=((-0.004763965913702149)*i); - xform.y[i].z=((-0.005800713697502058)*i); - xform.z[i].x=(0.001510600706713781*i); - xform.z[i].y=(0.007190585689165425*i); - xform.z[i].z=((-0.0011265440570958)*i); + xform.x[i].x=(float) (0.003962014134275617*i); + xform.x[i].y=(float) ((-0.002426619775463276)*i); + xform.x[i].z=(float) (0.006927257754597858*i); + xform.y[i].x=(float) (0.007778268551236748*i); + xform.y[i].y=(float) ((-0.004763965913702149)*i); + xform.y[i].z=(float) ((-0.005800713697502058)*i); + xform.z[i].x=(float) (0.001510600706713781*i); + xform.z[i].y=(float) (0.007190585689165425*i); + xform.z[i].z=(float) ((-0.0011265440570958)*i); } for ( ; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.2201118963486454*(1.099*i-0.099)); - xform.x[i].y=((-0.1348122097479598)*(1.099*i-0.099)); - xform.x[i].z=(0.3848476530332144*(1.099*i-0.099)); - xform.y[i].x=(0.4321260306242638*(1.099*i-0.099)); - xform.y[i].y=((-0.2646647729834528)*(1.099*i-0.099)); - xform.y[i].z=((-0.3222618720834477)*(1.099*i-0.099)); - xform.z[i].x=(0.08392226148409894*(1.099*i-0.099)); - xform.z[i].y=(0.3994769827314126*(1.099*i-0.099)); - xform.z[i].z=((-0.06258578094976668)*(1.099*i-0.099)); + xform.x[i].x=(float) (0.2201118963486454*(1.099*i-0.099)); + xform.x[i].y=(float) ((-0.1348122097479598)*(1.099*i-0.099)); + xform.x[i].z=(float) (0.3848476530332144*(1.099*i-0.099)); + xform.y[i].x=(float) (0.4321260306242638*(1.099*i-0.099)); + xform.y[i].y=(float) ((-0.2646647729834528)*(1.099*i-0.099)); + xform.y[i].z=(float) ((-0.3222618720834477)*(1.099*i-0.099)); + xform.z[i].x=(float) (0.08392226148409894*(1.099*i-0.099)); + xform.z[i].y=(float) (0.3994769827314126*(1.099*i-0.099)); + xform.z[i].z=(float) ((-0.06258578094976668)*(1.099*i-0.099)); } break; } @@ -856,15 +856,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.299f*(float) i); - xform.x[i].y=(0.596f*(float) i); - xform.x[i].z=(0.211f*(float) i); - xform.y[i].x=(0.587f*(float) i); - xform.y[i].y=((-0.274f)*(float) i); - xform.y[i].z=((-0.523f)*(float) i); - xform.z[i].x=(0.114f*(float) i); - xform.z[i].y=((-0.322f)*(float) i); - xform.z[i].z=(0.312f*(float) i); + xform.x[i].x=(float) (0.299f*(float) i); + xform.x[i].y=(float) (0.596f*(float) i); + xform.x[i].z=(float) (0.211f*(float) i); + xform.y[i].x=(float) (0.587f*(float) i); + xform.y[i].y=(float) ((-0.274f)*(float) i); + xform.y[i].z=(float) ((-0.523f)*(float) i); + xform.z[i].x=(float) (0.114f*(float) i); + xform.z[i].y=(float) ((-0.322f)*(float) i); + xform.z[i].z=(float) (0.312f*(float) i); } break; } @@ -889,15 +889,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.299f*(float) i); - xform.x[i].y=((-0.168736f)*(float) i); - xform.x[i].z=(0.5f*(float) i); - xform.y[i].x=(0.587f*(float) i); - xform.y[i].y=((-0.331264f)*(float) i); - xform.y[i].z=((-0.418688f)*(float) i); - xform.z[i].x=(0.114f*(float) i); - xform.z[i].y=(0.5f*(float) i); - xform.z[i].z=((-0.081312f)*(float) i); + xform.x[i].x=(float) (0.299f*(float) i); + xform.x[i].y=(float) ((-0.168736f)*(float) i); + xform.x[i].z=(float) (0.5f*(float) i); + xform.y[i].x=(float) (0.587f*(float) i); + xform.y[i].y=(float) ((-0.331264f)*(float) i); + xform.y[i].z=(float) ((-0.418688f)*(float) i); + xform.z[i].x=(float) (0.114f*(float) i); + xform.z[i].y=(float) (0.5f*(float) i); + xform.z[i].z=(float) ((-0.081312f)*(float) i); } break; } @@ -923,15 +923,15 @@ MagickExport MagickPassFail RGBTransformImage(Image *image, #endif for (i=0; i <= (long) MaxMap; i++) { - xform.x[i].x=(0.299f*(float) i); - xform.x[i].y=((-0.1474f)*(float) i); - xform.x[i].z=(0.615f*(float) i); - xform.y[i].x=(0.587f*(float) i); - xform.y[i].y=((-0.2895f)*(float) i); - xform.y[i].z=((-0.515f)*(float) i); - xform.z[i].x=(0.114f*(float) i); - xform.z[i].y=(0.4369f*(float) i); - xform.z[i].z=((-0.1f)*(float) i); + xform.x[i].x=(float) (0.299f*(float) i); + xform.x[i].y=(float) ((-0.1474f)*(float) i); + xform.x[i].z=(float) (0.615f*(float) i); + xform.y[i].x=(float) (0.587f*(float) i); + xform.y[i].y=(float) ((-0.2895f)*(float) i); + xform.y[i].z=(float) ((-0.515f)*(float) i); + xform.z[i].x=(float) (0.114f*(float) i); + xform.z[i].y=(float) (0.4369f*(float) i); + xform.z[i].z=(float) ((-0.1f)*(float) i); } break; } diff --git a/magick/command.c b/magick/command.c index 04ee069..f51017a 100644 --- a/magick/command.c +++ b/magick/command.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2020 GraphicsMagick Group +% Copyright (C) 2003 - 2022 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -63,7 +63,6 @@ #include "magick/log.h" #include "magick/magic.h" #include "magick/magick.h" -#include "magick/map.h" #include "magick/module.h" #include "magick/monitor.h" #include "magick/montage.h" @@ -270,7 +269,6 @@ static char commandline[MAX_PARAM_CHAR+2]; length (not including terminating null). */ #define TrimStringNewLine(text,length) \ do { \ - fprintf(stderr,"TrimStringNewLine\n"); \ if ((length > 1) && text[length-1] == '\n') \ text[length-1]='\0'; \ if ((length > 2) && text[length-2] == '\r') \ @@ -2311,6 +2309,9 @@ CompareImageCommand(ImageInfo *image_info, register long i; + MagickBool + auto_orient = MagickFalse; + unsigned int status; @@ -2400,7 +2401,12 @@ CompareImageCommand(ImageInfo *image_info, } break; } - ThrowCompareException(OptionError,UnrecognizedOption,option) + if (LocaleCompare("auto-orient",option+1) == 0) + { + auto_orient = MagickTrue; + break; + } + ThrowCompareException(OptionError,UnrecognizedOption,option); } case 'c': { @@ -2420,7 +2426,23 @@ CompareImageCommand(ImageInfo *image_info, } break; } - ThrowCompareException(OptionError,UnrecognizedOption,option) + if (LocaleCompare("compress",option+1) == 0) + { + image_info->compression=NoCompression; + if (*option == '-') + { + i++; + if (i == argc) + ThrowCompareException(OptionError,MissingArgument,option); + option=argv[i]; + image_info->compression=StringToCompressionType(option); + if (image_info->compression == UndefinedCompression) + ThrowCompareException(OptionError,UnrecognizedImageCompression, + option); + } + break; + } + ThrowCompareException(OptionError,UnrecognizedOption,option); } case 'd': { @@ -2765,6 +2787,7 @@ CompareImageCommand(ImageInfo *image_info, /* Apply any user settings to images prior to compare. */ + if (image_info->type != UndefinedType) { (void) SetImageType(reference_image,image_info->type); @@ -2777,6 +2800,46 @@ CompareImageCommand(ImageInfo *image_info, (void) TransformColorspace(compare_image,image_info->colorspace); } + if (auto_orient) + { + if (reference_image->orientation != UndefinedOrientation && + reference_image->orientation != TopLeftOrientation) + { + Image + *orient_image; + + orient_image = AutoOrientImage(reference_image,reference_image->orientation,exception); + if (orient_image != (Image *) NULL) + { + DestroyImageList(reference_image); + reference_image = orient_image; + } + } + if (compare_image->orientation != UndefinedOrientation && + compare_image->orientation != TopLeftOrientation) + { + Image + *orient_image; + + orient_image = AutoOrientImage(compare_image,compare_image->orientation,exception); + if (orient_image != (Image *) NULL) + { + DestroyImageList(compare_image); + compare_image = orient_image; + } + } + } + + /* + If user has not indicated a preference, then use StoreMatte if + either image has a matte channel. + */ + if ((UndefinedMatte == matte) && + (compare_image->matte || reference_image->matte)) + { + matte=StoreMatte; + } + if (matte != UndefinedMatte) { if (matte == IgnoreMatte) @@ -2904,7 +2967,9 @@ static void CompareUsage(void) (void) puts(""); (void) puts("Where options include:"); (void) puts(" -authenticate value decrypt image with this password"); + (void) puts(" -auto-orient orient (rotate) images so they are upright"); (void) puts(" -colorspace type alternate image colorspace"); + (void) puts(" -compress type image compression type"); (void) puts(" -debug events display copious debugging information"); (void) puts(" -define values coder/decoder specific options"); (void) puts(" -density geometry horizontal and vertical density of the image"); @@ -6266,6 +6331,7 @@ static void ConvertUsage(void) (void) puts(" -flip flip image in the vertical direction"); (void) puts(" -flop flop image in the horizontal direction"); (void) puts(" -font name render text with this font"); + (void) puts(" -format \"string\" output formatted image info for 'info:' format"); (void) puts(" -frame geometry surround image with an ornamental border"); (void) puts(" -fuzz distance colors within this distance are considered equal"); (void) puts(" -gamma value level of gamma correction"); @@ -11126,6 +11192,8 @@ MagickExport MagickPassFail MogrifyImage(const ImageInfo *image_info, } if (LocaleCompare("trim",option+1) == 0) { + /* SourceForge issue #653 Trim requires NorthWestGravity */ + (*image)->gravity=NorthWestGravity; TransformImage(image,"0x0",(char *) NULL); continue; } @@ -11662,7 +11730,7 @@ MagickExport MagickPassFail MogrifyImages(const ImageInfo *image_info, continue; next=0; /* FIXME: This code truncates the last character for an - argument like "analyze" but works for "analyze=" */ + argument like "Analyze" but works for "Analyze=" */ arguments=argv[i]; t_status=Tokenizer(&token_info,0,token,length,arguments, (char *) "",(char *) "=",(char *) "\"", @@ -16990,6 +17058,14 @@ static MagickPassFail VersionCommand(ImageInfo *image_info, #endif /* defined(HasGSLIB) */ PrintFeature("Ghostscript (Library)", supported); + /* HEIF/HVEC */ + /* FIXME: libheif also supports AVIF "HEIF/AVI" */ + supported=MagickFalse; +#if defined(HasHEIF) + supported=MagickTrue; +#endif /* defined(HasHEIF) */ + PrintFeature("HEIF/HVEC (\"HEIC\")",supported); + /* JBIG */ supported=MagickFalse; #if defined(HasJBIG) @@ -17011,6 +17087,13 @@ static MagickPassFail VersionCommand(ImageInfo *image_info, #endif /* defined(HasJPEG) */ PrintFeature("JPEG", supported); + /* JPEG XL */ + supported=MagickFalse; +#if defined(HasJXL) + supported=MagickTrue; +#endif /* defined(HasJXL) */ + PrintFeature("JPEG XL", supported); + /* Little CMS */ supported=MagickFalse; #if defined(HasLCMS) diff --git a/magick/compare.c b/magick/compare.c index edf3f18..3538fd7 100644 --- a/magick/compare.c +++ b/magick/compare.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2018 GraphicsMagick Group +% Copyright (C) 2003 - 2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -842,6 +842,11 @@ ComputePixelError(void *mutable_data, register long i; + const MagickBool + first_image_matte = first_image->matte, + second_image_matte = second_image->matte, + matte = (first_image->matte || second_image->matte); + ARG_NOT_USED(immutable_data); ARG_NOT_USED(first_indexes); ARG_NOT_USED(second_image); @@ -862,9 +867,11 @@ ComputePixelError(void *mutable_data, difference=(first_pixels[i].blue-(double) second_pixels[i].blue)/MaxRGBDouble; distance_squared+=(difference*difference); - if (first_image->matte) + if (matte) { - difference=(first_pixels[i].opacity-(double) second_pixels[i].opacity)/MaxRGBDouble; + const Quantum first_opacity = first_image_matte ? first_pixels[i].opacity : OpaqueOpacity; + const Quantum second_opacity = second_image_matte ? second_pixels[i].opacity : OpaqueOpacity; + difference=(first_opacity-(double) second_opacity)/MaxRGBDouble; distance_squared+=(difference*difference); } distance=sqrt(distance_squared); @@ -897,6 +904,9 @@ IsImagesEqual(Image *image,const Image *reference) normalize, number_pixels; + MagickBool + matte; + /* Initialize measurement. */ @@ -913,13 +923,11 @@ IsImagesEqual(Image *image,const Image *reference) (!IsRGBColorspace(image->colorspace) || !IsRGBColorspace(reference->colorspace))) ThrowBinaryException3(ImageError,UnableToCompareImages, ImageColorspaceDiffers); - if(image->matte != reference->matte) - ThrowBinaryException3(ImageError,UnableToCompareImages, - ImageOpacityDiffers); /* For each pixel, collect error statistics. */ + matte=(image->matte || reference->matte); number_pixels=(double) image->columns*image->rows; stats.maximum=0.0; @@ -938,7 +946,7 @@ IsImagesEqual(Image *image,const Image *reference) Compute final error statistics. */ - if (image->matte) + if (matte) normalize = sqrt(4.0); /* sqrt(1.0*1.0+1.0*1.0+1.0*1.0+1.0*1.0) */ else normalize = sqrt(3.0); /* sqrt(1.0*1.0+1.0*1.0+1.0*1.0) */ diff --git a/magick/constitute.c b/magick/constitute.c index 7930ee4..a25389b 100644 --- a/magick/constitute.c +++ b/magick/constitute.c @@ -2002,7 +2002,7 @@ static Image *ReadImages(const ImageInfo *image_info,ExceptionInfo *exception) command=(char *) FileToBlob(image_info->filename+1,&length,exception); if (command == (char *) NULL) return((Image *) NULL); - Strip(command); + (void) MagickStripString(command); images=StringToArgv(command,&number_images); MagickFreeMemory(command); if (images == (char **) NULL) diff --git a/magick/deprecate.c b/magick/deprecate.c index 5f53b67..3c83560 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2010 GraphicsMagick Group +% Copyright (C) 2003 - 2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -491,3 +491,32 @@ SyncCacheView(ViewInfo *view) { return SyncCacheViewPixels(view,&GetCacheViewImage(view)->exception); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S t r i p % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Method Strip strips any whitespace or quotes from the beginning and end of +% a string of characters. +% +% The format of the Strip method is: +% +% void Strip(char *message) +% +% A description of each parameter follows: +% +% o message: Specifies an array of characters. +% +% +*/ +MagickExport void Strip(char *message) +{ + (void) MagickStripString(message); +} diff --git a/magick/effect.c b/magick/effect.c index 296ec60..4e4aee2 100644 --- a/magick/effect.c +++ b/magick/effect.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2020 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -1374,7 +1374,7 @@ MagickExport Image *ConvolveImage(const Image * restrict image,const unsigned in normalize=1.0/normalize; for (i=0; i < (width*width); i++) { - normal_kernel[i]=normalize*kernel[i]; + normal_kernel[i]=(float_quantum_t) (normalize*kernel[i]); } } diff --git a/magick/enum_strings.c b/magick/enum_strings.c index 8f7a31c..745976c 100644 --- a/magick/enum_strings.c +++ b/magick/enum_strings.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2008-2019 GraphicsMagick Group +% Copyright (C) 2008-2022 GraphicsMagick Group % % This program is covered by multiple licenses, which are described in % Copyright.txt. You should have received a copy of Copyright.txt with this @@ -658,6 +658,46 @@ MagickExport CompressionType StringToCompressionType(const char *option) } /* + DisposeType + */ +MagickExport DisposeType StringToDisposeType(const char *option) +{ + DisposeType dispose_type = UndefinedDispose; + + if (LocaleCompare("None",option) == 0) + dispose_type = NoneDispose; + else if (LocaleCompare("Background",option) == 0) + dispose_type = BackgroundDispose; + else if (LocaleCompare("Previous",option) == 0) + dispose_type = PreviousDispose; + + return dispose_type; +} +MagickExport const char *DisposeTypeToString(const DisposeType dispose_type) +{ + const char + *dispose_string="?"; + + switch (dispose_type) + { + case UndefinedDispose: + dispose_string = "Undefined"; + break; + case NoneDispose: + dispose_string = "None"; + break; + case BackgroundDispose: + dispose_string = "Background"; + break; + case PreviousDispose: + dispose_string = "Previous"; + break; + } + + return dispose_string; +} + +/* ConfirmAccessMode */ MagickExport const char *ConfirmAccessModeToString(const ConfirmAccessMode access_mode) @@ -1620,6 +1660,8 @@ MagickExport ResourceType StringToResourceType(const char *option) resource_type=WidthResource; else if (LocaleCompare("Height",option) == 0) resource_type=HeightResource; + else if (LocaleCompare("Read",option) == 0) + resource_type=ReadResource; return resource_type; } diff --git a/magick/enum_strings.h b/magick/enum_strings.h index 4e3d271..c92b78c 100644 --- a/magick/enum_strings.h +++ b/magick/enum_strings.h @@ -33,6 +33,7 @@ extern "C" { extern MagickExport ColorspaceType StringToColorspaceType(const char *colorspace_string) MAGICK_FUNC_PURE; extern MagickExport CompositeOperator StringToCompositeOperator(const char *option) MAGICK_FUNC_PURE; extern MagickExport CompressionType StringToCompressionType(const char *option) MAGICK_FUNC_PURE; + extern MagickExport DisposeType StringToDisposeType(const char *option) MAGICK_FUNC_PURE; extern MagickExport EndianType StringToEndianType(const char *option) MAGICK_FUNC_PURE; extern MagickExport FilterTypes StringToFilterTypes(const char *option) MAGICK_FUNC_PURE; extern MagickExport GravityType StringToGravityType(const char *option) MAGICK_FUNC_PURE; @@ -54,6 +55,7 @@ extern "C" { extern MagickExport const char *CompositeOperatorToString(const CompositeOperator composite_op) MAGICK_FUNC_CONST; extern MagickExport const char *CompressionTypeToString(const CompressionType compression_type) MAGICK_FUNC_CONST; extern MagickExport const char *ConfirmAccessModeToString(const ConfirmAccessMode access_mode) MAGICK_FUNC_CONST; + extern MagickExport const char *DisposeTypeToString(const DisposeType dispose_type) MAGICK_FUNC_CONST; extern MagickExport const char *GravityTypeToString(const GravityType gravity_type) MAGICK_FUNC_CONST; extern MagickExport const char *EndianTypeToString(const EndianType endian_type) MAGICK_FUNC_CONST; extern MagickExport const char *HighlightStyleToString(const HighlightStyle difference_algorithm) MAGICK_FUNC_CONST; diff --git a/magick/fx.c b/magick/fx.c index d4d27c8..130f127 100644 --- a/magick/fx.c +++ b/magick/fx.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2022 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -214,17 +214,17 @@ ColorizeImagePixelsCB(void *mutable_data, /* User provided mutabl for (i=0; i < npixels; i++) { - new_pixels[i].red=(Quantum) - ((source_pixels[i].red*(100.0-options.amount.red)+ + new_pixels[i].red=RoundDoubleToQuantum + (((double) source_pixels[i].red*(100.0-options.amount.red)+ options.color.red*options.amount.red)/100.0); - new_pixels[i].green=(Quantum) - ((source_pixels[i].green*(100.0-options.amount.green)+ + new_pixels[i].green=RoundDoubleToQuantum + (((double) source_pixels[i].green*(100.0-options.amount.green)+ options.color.green*options.amount.green)/100.0); - new_pixels[i].blue=(Quantum) - ((source_pixels[i].blue*(100.0-options.amount.blue)+ + new_pixels[i].blue=RoundDoubleToQuantum + (((double) source_pixels[i].blue*(100.0-options.amount.blue)+ options.color.blue*options.amount.blue)/100.0); - new_pixels[i].opacity=(Quantum) - ((source_pixels[i].opacity*(100.0-options.amount.opacity)+ + new_pixels[i].opacity=RoundDoubleToQuantum + (((double) source_pixels[i].opacity*(100.0-options.amount.opacity)+ options.color.opacity*options.amount.opacity)/100.0); } diff --git a/magick/gem.c b/magick/gem.c index 42755d7..32b7e82 100644 --- a/magick/gem.c +++ b/magick/gem.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -196,10 +196,10 @@ MagickExport double GenerateDifferentialNoise(const Quantum quantum_pixel, pixel=(NOISE_FLT_T) quantum_pixel; #if QuantumDepth > 8 - pixel /= MaxRGBDouble/255.0; + pixel /= (NOISE_FLT_T) (MaxRGBDouble/255.0); #endif - alpha=MagickRandomRealInlined(kernel); + alpha=(NOISE_FLT_T) MagickRandomRealInlined(kernel); if (alpha == 0.0) alpha=1.0; switch (noise_type) @@ -215,7 +215,7 @@ MagickExport double GenerateDifferentialNoise(const Quantum quantum_pixel, float tau; - beta=MagickRandomRealInlined(kernel); + beta=(NOISE_FLT_T) MagickRandomRealInlined(kernel); sigma=SQRTF(-2.0*LOGF(alpha))*COSF(2.0*MagickPI*beta); tau=SQRTF(-2.0*LOGF(alpha))*SINF(2.0*MagickPI*beta); value=SQRTF(pixel)*SigmaGaussian*sigma+TauGaussian*tau; @@ -227,7 +227,7 @@ MagickExport double GenerateDifferentialNoise(const Quantum quantum_pixel, sigma=255.0; else sigma=SQRTF(-2.0*LOGF(alpha)); - beta=MagickRandomRealInlined(kernel); + beta=(NOISE_FLT_T) MagickRandomRealInlined(kernel); value=pixel*SigmaMultiplicativeGaussian*sigma*COSF(2.0*MagickPI*beta); break; } @@ -252,7 +252,7 @@ MagickExport double GenerateDifferentialNoise(const Quantum quantum_pixel, value=SigmaLaplacian*LOGF(2.0*alpha); break; } - beta=1.0-alpha; + beta=(NOISE_FLT_T) 1.0-alpha; if (beta <= (0.5*NoiseEpsilon)) value=255.0; else @@ -270,7 +270,7 @@ MagickExport double GenerateDifferentialNoise(const Quantum quantum_pixel, limit=exp(-SigmaPoisson*(double) pixel); for (i=0; alpha > limit; i++) { - beta=MagickRandomRealInlined(kernel); + beta=(NOISE_FLT_T) MagickRandomRealInlined(kernel); alpha=alpha*beta; } value=pixel-((double) i/SigmaPoisson); diff --git a/magick/image.c b/magick/image.c index 8644edd..a580a3d 100644 --- a/magick/image.c +++ b/magick/image.c @@ -3730,14 +3730,16 @@ StripImage(Image *image) % % % % % % -+ S y n c I m a g e % +% S y n c I m a g e % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Method SyncImage initializes the red, green, and blue intensities of each -% pixel as defined by the colormap index. +% pixel as defined by the colormap index and the current image colormap. +% This is a helper function to update the DirectClass representation of +% the image pixels after the PseudoClass representation has been updated. % % The format of the SyncImage method is: % diff --git a/magick/locale_c.h b/magick/locale_c.h index 4488050..f4ea804 100644 --- a/magick/locale_c.h +++ b/magick/locale_c.h @@ -3,7 +3,7 @@ extern MagickExport const char *GetLocaleMessageFromID(const int) MAGICK_FUNC_CONST; -#define MAX_LOCALE_MSGS 585 +#define MAX_LOCALE_MSGS 588 #define MGK_BlobErrorUnableToCreateBlob 1 #define MGK_BlobErrorUnableToDeduceImageFormat 2 @@ -219,377 +219,380 @@ extern MagickExport const char *GetLocaleMessageFromID(const int) MAGICK_FUNC_CO #define MGK_DrawErrorUnableToPrint 212 #define MGK_DrawErrorUnbalancedGraphicContextPushPop 213 #define MGK_DrawErrorUnbalancedPushPop 214 -#define MGK_DrawErrorUnreasonableDashPolygonLength 215 -#define MGK_DrawErrorUnreasonableGradientSize 216 -#define MGK_DrawErrorVectorPathTruncated 217 -#define MGK_DrawFatalErrorDefault 218 -#define MGK_DrawWarningNotARelativeURL 219 -#define MGK_DrawWarningNotCurrentlyPushingPatternDefinition 220 -#define MGK_DrawWarningURLNotFound 221 -#define MGK_FileOpenErrorUnableToCreateTemporaryFile 222 -#define MGK_FileOpenErrorUnableToOpenFile 223 -#define MGK_FileOpenErrorUnableToWriteFile 224 -#define MGK_FileOpenFatalErrorDefault 225 -#define MGK_FileOpenWarningDefault 226 -#define MGK_ImageErrorAngleIsDiscontinuous 227 -#define MGK_ImageErrorCMYKAImageLacksAlphaChannel 228 -#define MGK_ImageErrorColorspaceColorProfileMismatch 229 -#define MGK_ImageErrorImageColorspaceDiffers 230 -#define MGK_ImageErrorImageColorspaceMismatch 231 -#define MGK_ImageErrorImageDifferenceExceedsLimit 232 -#define MGK_ImageErrorImageDoesNotContainResolution 233 -#define MGK_ImageErrorImageIsNotColormapped 234 -#define MGK_ImageErrorImageOpacityDiffers 235 -#define MGK_ImageErrorImageSequenceIsRequired 236 -#define MGK_ImageErrorImageSizeDiffers 237 -#define MGK_ImageErrorInvalidColormapIndex 238 -#define MGK_ImageErrorLeftAndRightImageSizesDiffer 239 -#define MGK_ImageErrorNoImagesWereFound 240 -#define MGK_ImageErrorNoImagesWereLoaded 241 -#define MGK_ImageErrorNoLocaleImageAttribute 242 -#define MGK_ImageErrorTooManyClusters 243 -#define MGK_ImageErrorUnableToAppendImage 244 -#define MGK_ImageErrorUnableToAssignProfile 245 -#define MGK_ImageErrorUnableToAverageImage 246 -#define MGK_ImageErrorUnableToCoalesceImage 247 -#define MGK_ImageErrorUnableToCompareImages 248 -#define MGK_ImageErrorUnableToCreateImageMosaic 249 -#define MGK_ImageErrorUnableToCreateStereoImage 250 -#define MGK_ImageErrorUnableToDeconstructImageSequence 251 -#define MGK_ImageErrorUnableToExportImagePixels 252 -#define MGK_ImageErrorUnableToFlattenImage 253 -#define MGK_ImageErrorUnableToGetClipMask 254 -#define MGK_ImageErrorUnableToGetCompositeMask 255 -#define MGK_ImageErrorUnableToHandleImageChannel 256 -#define MGK_ImageErrorUnableToImportImagePixels 257 -#define MGK_ImageErrorUnableToResizeImage 258 -#define MGK_ImageErrorUnableToSegmentImage 259 -#define MGK_ImageErrorUnableToSetClipMask 260 -#define MGK_ImageErrorUnableToSetCompositeMask 261 -#define MGK_ImageErrorUnableToShearImage 262 -#define MGK_ImageErrorWidthOrHeightExceedsLimit 263 -#define MGK_ImageFatalErrorUnableToPersistKey 264 -#define MGK_ImageWarningDefault 265 -#define MGK_MissingDelegateErrorDPSLibraryIsNotAvailable 266 -#define MGK_MissingDelegateErrorFPXLibraryIsNotAvailable 267 -#define MGK_MissingDelegateErrorFreeTypeLibraryIsNotAvailable 268 -#define MGK_MissingDelegateErrorJPEGLibraryIsNotAvailable 269 -#define MGK_MissingDelegateErrorLCMSLibraryIsNotAvailable 270 -#define MGK_MissingDelegateErrorLZWEncodingNotEnabled 271 -#define MGK_MissingDelegateErrorNoDecodeDelegateForThisImageFormat 272 -#define MGK_MissingDelegateErrorNoEncodeDelegateForThisImageFormat 273 -#define MGK_MissingDelegateErrorTIFFLibraryIsNotAvailable 274 -#define MGK_MissingDelegateErrorXMLLibraryIsNotAvailable 275 -#define MGK_MissingDelegateErrorXWindowLibraryIsNotAvailable 276 -#define MGK_MissingDelegateErrorZipLibraryIsNotAvailable 277 -#define MGK_MissingDelegateFatalErrorDefault 278 -#define MGK_MissingDelegateWarningDefault 279 -#define MGK_ModuleErrorFailedToCloseModule 280 -#define MGK_ModuleErrorFailedToFindSymbol 281 -#define MGK_ModuleErrorUnableToLoadModule 282 -#define MGK_ModuleErrorUnableToRegisterImageFormat 283 -#define MGK_ModuleErrorUnrecognizedModule 284 -#define MGK_ModuleFatalErrorUnableToInitializeModuleLoader 285 -#define MGK_ModuleWarningDefault 286 -#define MGK_MonitorErrorDefault 287 -#define MGK_MonitorFatalErrorDefault 288 -#define MGK_MonitorFatalErrorUserRequestedTerminationBySignal 289 -#define MGK_MonitorWarningDefault 290 -#define MGK_OptionErrorBevelWidthIsNegative 291 -#define MGK_OptionErrorColorSeparatedImageRequired 292 -#define MGK_OptionErrorFrameIsLessThanImageSize 293 -#define MGK_OptionErrorGeometryDimensionsAreZero 294 -#define MGK_OptionErrorGeometryDoesNotContainImage 295 -#define MGK_OptionErrorHaldClutImageDimensionsInvalid 296 -#define MGK_OptionErrorImagesAreNotTheSameSize 297 -#define MGK_OptionErrorImageSizeMustExceedBevelWidth 298 -#define MGK_OptionErrorImageSmallerThanKernelWidth 299 -#define MGK_OptionErrorImageSmallerThanRadius 300 -#define MGK_OptionErrorImageWidthsOrHeightsDiffer 301 -#define MGK_OptionErrorInputImagesAlreadySpecified 302 -#define MGK_OptionErrorInvalidSubimageSpecification 303 -#define MGK_OptionErrorKernelRadiusIsTooSmall 304 -#define MGK_OptionErrorKernelWidthMustBeAnOddNumber 305 -#define MGK_OptionErrorMatrixIsNotSquare 306 -#define MGK_OptionErrorMatrixOrderOutOfRange 307 -#define MGK_OptionErrorMissingAnImageFilename 308 -#define MGK_OptionErrorMissingArgument 309 -#define MGK_OptionErrorMustSpecifyAnImageName 310 -#define MGK_OptionErrorMustSpecifyImageSize 311 -#define MGK_OptionErrorNoBlobDefined 312 -#define MGK_OptionErrorNoImagesDefined 313 -#define MGK_OptionErrorNonzeroWidthAndHeightRequired 314 -#define MGK_OptionErrorNoProfileNameWasGiven 315 -#define MGK_OptionErrorNullBlobArgument 316 -#define MGK_OptionErrorReferenceImageRequired 317 -#define MGK_OptionErrorReferenceIsNotMyType 318 -#define MGK_OptionErrorRegionAreaExceedsLimit 319 -#define MGK_OptionErrorRequestDidNotReturnAnImage 320 -#define MGK_OptionErrorSteganoImageRequired 321 -#define MGK_OptionErrorStereoImageRequired 322 -#define MGK_OptionErrorSubimageSpecificationReturnsNoImages 323 -#define MGK_OptionErrorTileNotBoundedByImageDimensions 324 -#define MGK_OptionErrorUnableToAddOrRemoveProfile 325 -#define MGK_OptionErrorUnableToAverageImageSequence 326 -#define MGK_OptionErrorUnableToBlurImage 327 -#define MGK_OptionErrorUnableToChopImage 328 -#define MGK_OptionErrorUnableToColorMatrixImage 329 -#define MGK_OptionErrorUnableToConstituteImage 330 -#define MGK_OptionErrorUnableToConvolveImage 331 -#define MGK_OptionErrorUnableToEdgeImage 332 -#define MGK_OptionErrorUnableToEqualizeImage 333 -#define MGK_OptionErrorUnableToFilterImage 334 -#define MGK_OptionErrorUnableToFormatImageMetadata 335 -#define MGK_OptionErrorUnableToFrameImage 336 -#define MGK_OptionErrorUnableToOilPaintImage 337 -#define MGK_OptionErrorUnableToPaintImage 338 -#define MGK_OptionErrorUnableToRaiseImage 339 -#define MGK_OptionErrorUnableToSharpenImage 340 -#define MGK_OptionErrorUnableToThresholdImage 341 -#define MGK_OptionErrorUnableToWaveImage 342 -#define MGK_OptionErrorUnrecognizedAttribute 343 -#define MGK_OptionErrorUnrecognizedChannelType 344 -#define MGK_OptionErrorUnrecognizedColor 345 -#define MGK_OptionErrorUnrecognizedColormapType 346 -#define MGK_OptionErrorUnrecognizedColorspace 347 -#define MGK_OptionErrorUnrecognizedCommand 348 -#define MGK_OptionErrorUnrecognizedComposeOperator 349 -#define MGK_OptionErrorUnrecognizedDisposeMethod 350 -#define MGK_OptionErrorUnrecognizedElement 351 -#define MGK_OptionErrorUnrecognizedEndianType 352 -#define MGK_OptionErrorUnrecognizedGravityType 353 -#define MGK_OptionErrorUnrecognizedHighlightStyle 354 -#define MGK_OptionErrorUnrecognizedImageCompression 355 -#define MGK_OptionErrorUnrecognizedImageFilter 356 -#define MGK_OptionErrorUnrecognizedImageFormat 357 -#define MGK_OptionErrorUnrecognizedImageMode 358 -#define MGK_OptionErrorUnrecognizedImageType 359 -#define MGK_OptionErrorUnrecognizedIntentType 360 -#define MGK_OptionErrorUnrecognizedInterlaceType 361 -#define MGK_OptionErrorUnrecognizedListType 362 -#define MGK_OptionErrorUnrecognizedMetric 363 -#define MGK_OptionErrorUnrecognizedModeType 364 -#define MGK_OptionErrorUnrecognizedNoiseType 365 -#define MGK_OptionErrorUnrecognizedOperator 366 -#define MGK_OptionErrorUnrecognizedOption 367 -#define MGK_OptionErrorUnrecognizedPerlMagickMethod 368 -#define MGK_OptionErrorUnrecognizedPixelMap 369 -#define MGK_OptionErrorUnrecognizedPreviewType 370 -#define MGK_OptionErrorUnrecognizedResourceType 371 -#define MGK_OptionErrorUnrecognizedType 372 -#define MGK_OptionErrorUnrecognizedUnitsType 373 -#define MGK_OptionErrorUnrecognizedVirtualPixelMethod 374 -#define MGK_OptionErrorUnsupportedSamplingFactor 375 -#define MGK_OptionErrorUsageError 376 -#define MGK_OptionFatalErrorInvalidColorspaceType 377 -#define MGK_OptionFatalErrorInvalidEndianType 378 -#define MGK_OptionFatalErrorInvalidImageType 379 -#define MGK_OptionFatalErrorInvalidInterlaceType 380 -#define MGK_OptionFatalErrorMissingAnImageFilename 381 -#define MGK_OptionFatalErrorMissingArgument 382 -#define MGK_OptionFatalErrorNoImagesWereLoaded 383 -#define MGK_OptionFatalErrorOptionLengthExceedsLimit 384 -#define MGK_OptionFatalErrorRequestDidNotReturnAnImage 385 -#define MGK_OptionFatalErrorUnableToOpenXServer 386 -#define MGK_OptionFatalErrorUnableToPersistKey 387 -#define MGK_OptionFatalErrorUnrecognizedColormapType 388 -#define MGK_OptionFatalErrorUnrecognizedColorspaceType 389 -#define MGK_OptionFatalErrorUnrecognizedDisposeMethod 390 -#define MGK_OptionFatalErrorUnrecognizedEndianType 391 -#define MGK_OptionFatalErrorUnrecognizedFilterType 392 -#define MGK_OptionFatalErrorUnrecognizedImageCompressionType 393 -#define MGK_OptionFatalErrorUnrecognizedImageType 394 -#define MGK_OptionFatalErrorUnrecognizedInterlaceType 395 -#define MGK_OptionFatalErrorUnrecognizedOption 396 -#define MGK_OptionFatalErrorUnrecognizedResourceType 397 -#define MGK_OptionFatalErrorUnrecognizedVirtualPixelMethod 398 -#define MGK_OptionWarningUnrecognizedColor 399 -#define MGK_RegistryErrorImageExpected 400 -#define MGK_RegistryErrorImageInfoExpected 401 -#define MGK_RegistryErrorStructureSizeMismatch 402 -#define MGK_RegistryErrorUnableToGetRegistryID 403 -#define MGK_RegistryErrorUnableToLocateImage 404 -#define MGK_RegistryErrorUnableToSetRegistry 405 -#define MGK_RegistryFatalErrorDefault 406 -#define MGK_RegistryWarningDefault 407 -#define MGK_ResourceLimitErrorCacheResourcesExhausted 408 -#define MGK_ResourceLimitErrorImagePixelHeightLimitExceeded 409 -#define MGK_ResourceLimitErrorImagePixelLimitExceeded 410 -#define MGK_ResourceLimitErrorImagePixelWidthLimitExceeded 411 -#define MGK_ResourceLimitErrorMemoryAllocationFailed 412 -#define MGK_ResourceLimitErrorNexusPixelHeightLimitExceeded 413 -#define MGK_ResourceLimitErrorNexusPixelLimitExceeded 414 -#define MGK_ResourceLimitErrorNexusPixelWidthLimitExceeded 415 -#define MGK_ResourceLimitErrorNoPixelsDefinedInCache 416 -#define MGK_ResourceLimitErrorPixelCacheAllocationFailed 417 -#define MGK_ResourceLimitErrorUnableToAddColorProfile 418 -#define MGK_ResourceLimitErrorUnableToAddGenericProfile 419 -#define MGK_ResourceLimitErrorUnableToAddIPTCProfile 420 -#define MGK_ResourceLimitErrorUnableToAddOrRemoveProfile 421 -#define MGK_ResourceLimitErrorUnableToAllocateCoefficients 422 -#define MGK_ResourceLimitErrorUnableToAllocateColormap 423 -#define MGK_ResourceLimitErrorUnableToAllocateICCProfile 424 -#define MGK_ResourceLimitErrorUnableToAllocateImage 425 -#define MGK_ResourceLimitErrorUnableToAllocateString 426 -#define MGK_ResourceLimitErrorUnableToAnnotateImage 427 -#define MGK_ResourceLimitErrorUnableToAverageImageSequence 428 -#define MGK_ResourceLimitErrorUnableToCloneDrawingWand 429 -#define MGK_ResourceLimitErrorUnableToCloneImage 430 -#define MGK_ResourceLimitErrorUnableToComputeImageSignature 431 -#define MGK_ResourceLimitErrorUnableToConstituteImage 432 -#define MGK_ResourceLimitErrorUnableToConvertFont 433 -#define MGK_ResourceLimitErrorUnableToConvertStringToTokens 434 -#define MGK_ResourceLimitErrorUnableToCreateColormap 435 -#define MGK_ResourceLimitErrorUnableToCreateColorTransform 436 -#define MGK_ResourceLimitErrorUnableToCreateCommandWidget 437 -#define MGK_ResourceLimitErrorUnableToCreateImageGroup 438 -#define MGK_ResourceLimitErrorUnableToCreateImageMontage 439 -#define MGK_ResourceLimitErrorUnableToCreateXWindow 440 -#define MGK_ResourceLimitErrorUnableToCropImage 441 -#define MGK_ResourceLimitErrorUnableToDespeckleImage 442 -#define MGK_ResourceLimitErrorUnableToDetermineImageClass 443 -#define MGK_ResourceLimitErrorUnableToDetermineTheNumberOfImageColors 444 -#define MGK_ResourceLimitErrorUnableToDitherImage 445 -#define MGK_ResourceLimitErrorUnableToDrawOnImage 446 -#define MGK_ResourceLimitErrorUnableToEdgeImage 447 -#define MGK_ResourceLimitErrorUnableToEmbossImage 448 -#define MGK_ResourceLimitErrorUnableToEnhanceImage 449 -#define MGK_ResourceLimitErrorUnableToFloodfillImage 450 -#define MGK_ResourceLimitErrorUnableToGammaCorrectImage 451 -#define MGK_ResourceLimitErrorUnableToGetBestIconSize 452 -#define MGK_ResourceLimitErrorUnableToGetFromRegistry 453 -#define MGK_ResourceLimitErrorUnableToGetPackageInfo 454 -#define MGK_ResourceLimitErrorUnableToLevelImage 455 -#define MGK_ResourceLimitErrorUnableToMagnifyImage 456 -#define MGK_ResourceLimitErrorUnableToManageColor 457 -#define MGK_ResourceLimitErrorUnableToMapImage 458 -#define MGK_ResourceLimitErrorUnableToMapImageSequence 459 -#define MGK_ResourceLimitErrorUnableToMedianFilterImage 460 -#define MGK_ResourceLimitErrorUnableToMotionBlurImage 461 -#define MGK_ResourceLimitErrorUnableToNoiseFilterImage 462 -#define MGK_ResourceLimitErrorUnableToNormalizeImage 463 -#define MGK_ResourceLimitErrorUnableToOpenColorProfile 464 -#define MGK_ResourceLimitErrorUnableToQuantizeImage 465 -#define MGK_ResourceLimitErrorUnableToQuantizeImageSequence 466 -#define MGK_ResourceLimitErrorUnableToReadTextChunk 467 -#define MGK_ResourceLimitErrorUnableToReadXImage 468 -#define MGK_ResourceLimitErrorUnableToReadXServerColormap 469 -#define MGK_ResourceLimitErrorUnableToResizeImage 470 -#define MGK_ResourceLimitErrorUnableToRotateImage 471 -#define MGK_ResourceLimitErrorUnableToSampleImage 472 -#define MGK_ResourceLimitErrorUnableToScaleImage 473 -#define MGK_ResourceLimitErrorUnableToSelectImage 474 -#define MGK_ResourceLimitErrorUnableToSharpenImage 475 -#define MGK_ResourceLimitErrorUnableToShaveImage 476 -#define MGK_ResourceLimitErrorUnableToShearImage 477 -#define MGK_ResourceLimitErrorUnableToSortImageColormap 478 -#define MGK_ResourceLimitErrorUnableToThresholdImage 479 -#define MGK_ResourceLimitErrorUnableToTransformColorspace 480 -#define MGK_ResourceLimitFatalErrorMemoryAllocationFailed 481 -#define MGK_ResourceLimitFatalErrorSemaporeOperationFailed 482 -#define MGK_ResourceLimitFatalErrorUnableToAllocateAscii85Info 483 -#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheInfo 484 -#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheView 485 -#define MGK_ResourceLimitFatalErrorUnableToAllocateColorInfo 486 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDashPattern 487 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDelegateInfo 488 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDerivatives 489 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawContext 490 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawInfo 491 -#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawingWand 492 -#define MGK_ResourceLimitFatalErrorUnableToAllocateGammaMap 493 -#define MGK_ResourceLimitFatalErrorUnableToAllocateImage 494 -#define MGK_ResourceLimitFatalErrorUnableToAllocateImagePixels 495 -#define MGK_ResourceLimitFatalErrorUnableToAllocateLogInfo 496 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagicInfo 497 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickInfo 498 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickMap 499 -#define MGK_ResourceLimitFatalErrorUnableToAllocateModuleInfo 500 -#define MGK_ResourceLimitFatalErrorUnableToAllocateMontageInfo 501 -#define MGK_ResourceLimitFatalErrorUnableToAllocateQuantizeInfo 502 -#define MGK_ResourceLimitFatalErrorUnableToAllocateRandomKernel 503 -#define MGK_ResourceLimitFatalErrorUnableToAllocateRegistryInfo 504 -#define MGK_ResourceLimitFatalErrorUnableToAllocateSemaphoreInfo 505 -#define MGK_ResourceLimitFatalErrorUnableToAllocateString 506 -#define MGK_ResourceLimitFatalErrorUnableToAllocateTypeInfo 507 -#define MGK_ResourceLimitFatalErrorUnableToAllocateWand 508 -#define MGK_ResourceLimitFatalErrorUnableToAnimateImageSequence 509 -#define MGK_ResourceLimitFatalErrorUnableToCloneBlobInfo 510 -#define MGK_ResourceLimitFatalErrorUnableToCloneCacheInfo 511 -#define MGK_ResourceLimitFatalErrorUnableToCloneImage 512 -#define MGK_ResourceLimitFatalErrorUnableToCloneImageInfo 513 -#define MGK_ResourceLimitFatalErrorUnableToConcatenateString 514 -#define MGK_ResourceLimitFatalErrorUnableToConvertText 515 -#define MGK_ResourceLimitFatalErrorUnableToCreateColormap 516 -#define MGK_ResourceLimitFatalErrorUnableToDestroySemaphore 517 -#define MGK_ResourceLimitFatalErrorUnableToDisplayImage 518 -#define MGK_ResourceLimitFatalErrorUnableToEscapeString 519 -#define MGK_ResourceLimitFatalErrorUnableToInitializeSemaphore 520 -#define MGK_ResourceLimitFatalErrorUnableToInterpretMSLImage 521 -#define MGK_ResourceLimitFatalErrorUnableToLockSemaphore 522 -#define MGK_ResourceLimitFatalErrorUnableToObtainRandomEntropy 523 -#define MGK_ResourceLimitFatalErrorUnableToUnlockSemaphore 524 -#define MGK_ResourceLimitWarningMemoryAllocationFailed 525 -#define MGK_StreamErrorImageDoesNotContainTheStreamGeometry 526 -#define MGK_StreamErrorNoStreamHandlerIsDefined 527 -#define MGK_StreamErrorPixelCacheIsNotOpen 528 -#define MGK_StreamErrorUnableToAcquirePixelStream 529 -#define MGK_StreamErrorUnableToSetPixelStream 530 -#define MGK_StreamErrorUnableToSyncPixelStream 531 -#define MGK_StreamFatalErrorDefault 532 -#define MGK_StreamWarningDefault 533 -#define MGK_TypeErrorFontNotSpecified 534 -#define MGK_TypeErrorFontSubstitutionRequired 535 -#define MGK_TypeErrorUnableToGetTypeMetrics 536 -#define MGK_TypeErrorUnableToInitializeFreetypeLibrary 537 -#define MGK_TypeErrorUnableToReadFont 538 -#define MGK_TypeErrorUnrecognizedFontEncoding 539 -#define MGK_TypeFatalErrorDefault 540 -#define MGK_TypeWarningDefault 541 -#define MGK_WandErrorInvalidColormapIndex 542 -#define MGK_WandErrorWandAPINotImplemented 543 -#define MGK_WandErrorWandContainsNoImageIndexs 544 -#define MGK_WandErrorWandContainsNoImages 545 -#define MGK_XServerErrorColorIsNotKnownToServer 546 -#define MGK_XServerErrorNoWindowWithSpecifiedIDExists 547 -#define MGK_XServerErrorStandardColormapIsNotInitialized 548 -#define MGK_XServerErrorUnableToConnectToRemoteDisplay 549 -#define MGK_XServerErrorUnableToCreateBitmap 550 -#define MGK_XServerErrorUnableToCreateColormap 551 -#define MGK_XServerErrorUnableToCreatePixmap 552 -#define MGK_XServerErrorUnableToCreateProperty 553 -#define MGK_XServerErrorUnableToCreateStandardColormap 554 -#define MGK_XServerErrorUnableToDisplayImageInfo 555 -#define MGK_XServerErrorUnableToGetProperty 556 -#define MGK_XServerErrorUnableToGetStandardColormap 557 -#define MGK_XServerErrorUnableToGetVisual 558 -#define MGK_XServerErrorUnableToGrabMouse 559 -#define MGK_XServerErrorUnableToLoadFont 560 -#define MGK_XServerErrorUnableToMatchVisualToStandardColormap 561 -#define MGK_XServerErrorUnableToOpenXServer 562 -#define MGK_XServerErrorUnableToReadXAttributes 563 -#define MGK_XServerErrorUnableToReadXWindowImage 564 -#define MGK_XServerErrorUnrecognizedColormapType 565 -#define MGK_XServerErrorUnrecognizedGravityType 566 -#define MGK_XServerErrorUnrecognizedVisualSpecifier 567 -#define MGK_XServerFatalErrorUnableToAllocateXHints 568 -#define MGK_XServerFatalErrorUnableToCreateCursor 569 -#define MGK_XServerFatalErrorUnableToCreateGraphicContext 570 -#define MGK_XServerFatalErrorUnableToCreateStandardColormap 571 -#define MGK_XServerFatalErrorUnableToCreateTextProperty 572 -#define MGK_XServerFatalErrorUnableToCreateXImage 573 -#define MGK_XServerFatalErrorUnableToCreateXPixmap 574 -#define MGK_XServerFatalErrorUnableToCreateXWindow 575 -#define MGK_XServerFatalErrorUnableToDisplayImage 576 -#define MGK_XServerFatalErrorUnableToDitherImage 577 -#define MGK_XServerFatalErrorUnableToGetPixelInfo 578 -#define MGK_XServerFatalErrorUnableToGetVisual 579 -#define MGK_XServerFatalErrorUnableToLoadFont 580 -#define MGK_XServerFatalErrorUnableToMakeXWindow 581 -#define MGK_XServerFatalErrorUnableToOpenXServer 582 -#define MGK_XServerFatalErrorUnableToViewFonts 583 -#define MGK_XServerWarningUnableToGetVisual 584 -#define MGK_XServerWarningUsingDefaultVisual 585 +#define MGK_DrawErrorUnreasonableAffineMatrix 215 +#define MGK_DrawErrorUnreasonableDashPolygonLength 216 +#define MGK_DrawErrorUnreasonableGradientSize 217 +#define MGK_DrawErrorVectorPathTruncated 218 +#define MGK_DrawFatalErrorDefault 219 +#define MGK_DrawWarningNotARelativeURL 220 +#define MGK_DrawWarningNotCurrentlyPushingPatternDefinition 221 +#define MGK_DrawWarningURLNotFound 222 +#define MGK_FileOpenErrorUnableToCreateTemporaryFile 223 +#define MGK_FileOpenErrorUnableToOpenFile 224 +#define MGK_FileOpenErrorUnableToWriteFile 225 +#define MGK_FileOpenFatalErrorDefault 226 +#define MGK_FileOpenWarningDefault 227 +#define MGK_ImageErrorAngleIsDiscontinuous 228 +#define MGK_ImageErrorCMYKAImageLacksAlphaChannel 229 +#define MGK_ImageErrorColorspaceColorProfileMismatch 230 +#define MGK_ImageErrorImageColorspaceDiffers 231 +#define MGK_ImageErrorImageColorspaceMismatch 232 +#define MGK_ImageErrorImageDifferenceExceedsLimit 233 +#define MGK_ImageErrorImageDoesNotContainResolution 234 +#define MGK_ImageErrorImageIsNotColormapped 235 +#define MGK_ImageErrorImageOpacityDiffers 236 +#define MGK_ImageErrorImageSequenceIsRequired 237 +#define MGK_ImageErrorImageSizeDiffers 238 +#define MGK_ImageErrorInvalidColormapIndex 239 +#define MGK_ImageErrorLeftAndRightImageSizesDiffer 240 +#define MGK_ImageErrorNoImagesWereFound 241 +#define MGK_ImageErrorNoImagesWereLoaded 242 +#define MGK_ImageErrorNoLocaleImageAttribute 243 +#define MGK_ImageErrorTooManyClusters 244 +#define MGK_ImageErrorUnableToAppendImage 245 +#define MGK_ImageErrorUnableToAssignProfile 246 +#define MGK_ImageErrorUnableToAverageImage 247 +#define MGK_ImageErrorUnableToCoalesceImage 248 +#define MGK_ImageErrorUnableToCompareImages 249 +#define MGK_ImageErrorUnableToCreateImageMosaic 250 +#define MGK_ImageErrorUnableToCreateStereoImage 251 +#define MGK_ImageErrorUnableToDeconstructImageSequence 252 +#define MGK_ImageErrorUnableToExportImagePixels 253 +#define MGK_ImageErrorUnableToFlattenImage 254 +#define MGK_ImageErrorUnableToGetClipMask 255 +#define MGK_ImageErrorUnableToGetCompositeMask 256 +#define MGK_ImageErrorUnableToHandleImageChannel 257 +#define MGK_ImageErrorUnableToImportImagePixels 258 +#define MGK_ImageErrorUnableToResizeImage 259 +#define MGK_ImageErrorUnableToSegmentImage 260 +#define MGK_ImageErrorUnableToSetClipMask 261 +#define MGK_ImageErrorUnableToSetCompositeMask 262 +#define MGK_ImageErrorUnableToShearImage 263 +#define MGK_ImageErrorWidthOrHeightExceedsLimit 264 +#define MGK_ImageFatalErrorUnableToPersistKey 265 +#define MGK_ImageWarningDefault 266 +#define MGK_MissingDelegateErrorDPSLibraryIsNotAvailable 267 +#define MGK_MissingDelegateErrorFPXLibraryIsNotAvailable 268 +#define MGK_MissingDelegateErrorFreeTypeLibraryIsNotAvailable 269 +#define MGK_MissingDelegateErrorJPEGLibraryIsNotAvailable 270 +#define MGK_MissingDelegateErrorLCMSLibraryIsNotAvailable 271 +#define MGK_MissingDelegateErrorLZWEncodingNotEnabled 272 +#define MGK_MissingDelegateErrorNoDecodeDelegateForThisImageFormat 273 +#define MGK_MissingDelegateErrorNoEncodeDelegateForThisImageFormat 274 +#define MGK_MissingDelegateErrorTIFFLibraryIsNotAvailable 275 +#define MGK_MissingDelegateErrorXMLLibraryIsNotAvailable 276 +#define MGK_MissingDelegateErrorXWindowLibraryIsNotAvailable 277 +#define MGK_MissingDelegateErrorZipLibraryIsNotAvailable 278 +#define MGK_MissingDelegateFatalErrorDefault 279 +#define MGK_MissingDelegateWarningDefault 280 +#define MGK_ModuleErrorFailedToCloseModule 281 +#define MGK_ModuleErrorFailedToFindSymbol 282 +#define MGK_ModuleErrorUnableToLoadModule 283 +#define MGK_ModuleErrorUnableToRegisterImageFormat 284 +#define MGK_ModuleErrorUnrecognizedModule 285 +#define MGK_ModuleFatalErrorUnableToInitializeModuleLoader 286 +#define MGK_ModuleWarningDefault 287 +#define MGK_MonitorErrorDefault 288 +#define MGK_MonitorFatalErrorDefault 289 +#define MGK_MonitorFatalErrorUserRequestedTerminationBySignal 290 +#define MGK_MonitorWarningDefault 291 +#define MGK_OptionErrorBevelWidthIsNegative 292 +#define MGK_OptionErrorColorSeparatedImageRequired 293 +#define MGK_OptionErrorFrameIsLessThanImageSize 294 +#define MGK_OptionErrorGeometryDimensionsAreZero 295 +#define MGK_OptionErrorGeometryDoesNotContainImage 296 +#define MGK_OptionErrorHaldClutImageDimensionsInvalid 297 +#define MGK_OptionErrorImagesAreNotTheSameSize 298 +#define MGK_OptionErrorImageSizeMustExceedBevelWidth 299 +#define MGK_OptionErrorImageSmallerThanKernelWidth 300 +#define MGK_OptionErrorImageSmallerThanRadius 301 +#define MGK_OptionErrorImageWidthsOrHeightsDiffer 302 +#define MGK_OptionErrorInputImagesAlreadySpecified 303 +#define MGK_OptionErrorInvalidSubimageSpecification 304 +#define MGK_OptionErrorKernelRadiusIsTooSmall 305 +#define MGK_OptionErrorKernelWidthMustBeAnOddNumber 306 +#define MGK_OptionErrorMatrixIsNotSquare 307 +#define MGK_OptionErrorMatrixOrderOutOfRange 308 +#define MGK_OptionErrorMissingAnImageFilename 309 +#define MGK_OptionErrorMissingArgument 310 +#define MGK_OptionErrorMustSpecifyAnImageName 311 +#define MGK_OptionErrorMustSpecifyImageSize 312 +#define MGK_OptionErrorNoBlobDefined 313 +#define MGK_OptionErrorNoImagesDefined 314 +#define MGK_OptionErrorNonzeroWidthAndHeightRequired 315 +#define MGK_OptionErrorNoProfileNameWasGiven 316 +#define MGK_OptionErrorNullBlobArgument 317 +#define MGK_OptionErrorReferenceImageRequired 318 +#define MGK_OptionErrorReferenceIsNotMyType 319 +#define MGK_OptionErrorRegionAreaExceedsLimit 320 +#define MGK_OptionErrorRequestDidNotReturnAnImage 321 +#define MGK_OptionErrorSteganoImageRequired 322 +#define MGK_OptionErrorStereoImageRequired 323 +#define MGK_OptionErrorSubimageSpecificationReturnsNoImages 324 +#define MGK_OptionErrorTileNotBoundedByImageDimensions 325 +#define MGK_OptionErrorUnableToAddOrRemoveProfile 326 +#define MGK_OptionErrorUnableToAverageImageSequence 327 +#define MGK_OptionErrorUnableToBlurImage 328 +#define MGK_OptionErrorUnableToChopImage 329 +#define MGK_OptionErrorUnableToColorMatrixImage 330 +#define MGK_OptionErrorUnableToConstituteImage 331 +#define MGK_OptionErrorUnableToConvolveImage 332 +#define MGK_OptionErrorUnableToEdgeImage 333 +#define MGK_OptionErrorUnableToEqualizeImage 334 +#define MGK_OptionErrorUnableToFilterImage 335 +#define MGK_OptionErrorUnableToFormatImageMetadata 336 +#define MGK_OptionErrorUnableToFrameImage 337 +#define MGK_OptionErrorUnableToOilPaintImage 338 +#define MGK_OptionErrorUnableToPaintImage 339 +#define MGK_OptionErrorUnableToRaiseImage 340 +#define MGK_OptionErrorUnableToSharpenImage 341 +#define MGK_OptionErrorUnableToThresholdImage 342 +#define MGK_OptionErrorUnableToWaveImage 343 +#define MGK_OptionErrorUnrecognizedAttribute 344 +#define MGK_OptionErrorUnrecognizedChannelType 345 +#define MGK_OptionErrorUnrecognizedColor 346 +#define MGK_OptionErrorUnrecognizedColormapType 347 +#define MGK_OptionErrorUnrecognizedColorspace 348 +#define MGK_OptionErrorUnrecognizedCommand 349 +#define MGK_OptionErrorUnrecognizedComposeOperator 350 +#define MGK_OptionErrorUnrecognizedDisposeMethod 351 +#define MGK_OptionErrorUnrecognizedElement 352 +#define MGK_OptionErrorUnrecognizedEndianType 353 +#define MGK_OptionErrorUnrecognizedGravityType 354 +#define MGK_OptionErrorUnrecognizedHighlightStyle 355 +#define MGK_OptionErrorUnrecognizedImageCompression 356 +#define MGK_OptionErrorUnrecognizedImageFilter 357 +#define MGK_OptionErrorUnrecognizedImageFormat 358 +#define MGK_OptionErrorUnrecognizedImageMode 359 +#define MGK_OptionErrorUnrecognizedImageType 360 +#define MGK_OptionErrorUnrecognizedIntentType 361 +#define MGK_OptionErrorUnrecognizedInterlaceType 362 +#define MGK_OptionErrorUnrecognizedListType 363 +#define MGK_OptionErrorUnrecognizedMetric 364 +#define MGK_OptionErrorUnrecognizedModeType 365 +#define MGK_OptionErrorUnrecognizedNoiseType 366 +#define MGK_OptionErrorUnrecognizedOperator 367 +#define MGK_OptionErrorUnrecognizedOption 368 +#define MGK_OptionErrorUnrecognizedPerlMagickMethod 369 +#define MGK_OptionErrorUnrecognizedPixelMap 370 +#define MGK_OptionErrorUnrecognizedPreviewType 371 +#define MGK_OptionErrorUnrecognizedResourceType 372 +#define MGK_OptionErrorUnrecognizedType 373 +#define MGK_OptionErrorUnrecognizedUnitsType 374 +#define MGK_OptionErrorUnrecognizedVirtualPixelMethod 375 +#define MGK_OptionErrorUnsupportedSamplingFactor 376 +#define MGK_OptionErrorUsageError 377 +#define MGK_OptionFatalErrorInvalidColorspaceType 378 +#define MGK_OptionFatalErrorInvalidEndianType 379 +#define MGK_OptionFatalErrorInvalidImageType 380 +#define MGK_OptionFatalErrorInvalidInterlaceType 381 +#define MGK_OptionFatalErrorMissingAnImageFilename 382 +#define MGK_OptionFatalErrorMissingArgument 383 +#define MGK_OptionFatalErrorNoImagesWereLoaded 384 +#define MGK_OptionFatalErrorOptionLengthExceedsLimit 385 +#define MGK_OptionFatalErrorRequestDidNotReturnAnImage 386 +#define MGK_OptionFatalErrorUnableToOpenXServer 387 +#define MGK_OptionFatalErrorUnableToPersistKey 388 +#define MGK_OptionFatalErrorUnrecognizedColormapType 389 +#define MGK_OptionFatalErrorUnrecognizedColorspaceType 390 +#define MGK_OptionFatalErrorUnrecognizedDisposeMethod 391 +#define MGK_OptionFatalErrorUnrecognizedEndianType 392 +#define MGK_OptionFatalErrorUnrecognizedFilterType 393 +#define MGK_OptionFatalErrorUnrecognizedImageCompressionType 394 +#define MGK_OptionFatalErrorUnrecognizedImageType 395 +#define MGK_OptionFatalErrorUnrecognizedInterlaceType 396 +#define MGK_OptionFatalErrorUnrecognizedOption 397 +#define MGK_OptionFatalErrorUnrecognizedResourceType 398 +#define MGK_OptionFatalErrorUnrecognizedVirtualPixelMethod 399 +#define MGK_OptionWarningUnrecognizedColor 400 +#define MGK_RegistryErrorImageExpected 401 +#define MGK_RegistryErrorImageInfoExpected 402 +#define MGK_RegistryErrorStructureSizeMismatch 403 +#define MGK_RegistryErrorUnableToGetRegistryID 404 +#define MGK_RegistryErrorUnableToLocateImage 405 +#define MGK_RegistryErrorUnableToSetRegistry 406 +#define MGK_RegistryFatalErrorDefault 407 +#define MGK_RegistryWarningDefault 408 +#define MGK_ResourceLimitErrorCacheResourcesExhausted 409 +#define MGK_ResourceLimitErrorImagePixelHeightLimitExceeded 410 +#define MGK_ResourceLimitErrorImagePixelLimitExceeded 411 +#define MGK_ResourceLimitErrorImagePixelWidthLimitExceeded 412 +#define MGK_ResourceLimitErrorMemoryAllocationFailed 413 +#define MGK_ResourceLimitErrorNexusPixelHeightLimitExceeded 414 +#define MGK_ResourceLimitErrorNexusPixelLimitExceeded 415 +#define MGK_ResourceLimitErrorNexusPixelWidthLimitExceeded 416 +#define MGK_ResourceLimitErrorNoPixelsDefinedInCache 417 +#define MGK_ResourceLimitErrorPixelCacheAllocationFailed 418 +#define MGK_ResourceLimitErrorReadLimitExceeded 419 +#define MGK_ResourceLimitErrorUnableToAddColorProfile 420 +#define MGK_ResourceLimitErrorUnableToAddGenericProfile 421 +#define MGK_ResourceLimitErrorUnableToAddIPTCProfile 422 +#define MGK_ResourceLimitErrorUnableToAddOrRemoveProfile 423 +#define MGK_ResourceLimitErrorUnableToAllocateCoefficients 424 +#define MGK_ResourceLimitErrorUnableToAllocateColormap 425 +#define MGK_ResourceLimitErrorUnableToAllocateICCProfile 426 +#define MGK_ResourceLimitErrorUnableToAllocateImage 427 +#define MGK_ResourceLimitErrorUnableToAllocateString 428 +#define MGK_ResourceLimitErrorUnableToAnnotateImage 429 +#define MGK_ResourceLimitErrorUnableToAverageImageSequence 430 +#define MGK_ResourceLimitErrorUnableToCloneDrawingWand 431 +#define MGK_ResourceLimitErrorUnableToCloneImage 432 +#define MGK_ResourceLimitErrorUnableToComputeImageSignature 433 +#define MGK_ResourceLimitErrorUnableToConstituteImage 434 +#define MGK_ResourceLimitErrorUnableToConvertFont 435 +#define MGK_ResourceLimitErrorUnableToConvertStringToTokens 436 +#define MGK_ResourceLimitErrorUnableToCreateColormap 437 +#define MGK_ResourceLimitErrorUnableToCreateColorTransform 438 +#define MGK_ResourceLimitErrorUnableToCreateCommandWidget 439 +#define MGK_ResourceLimitErrorUnableToCreateImageGroup 440 +#define MGK_ResourceLimitErrorUnableToCreateImageMontage 441 +#define MGK_ResourceLimitErrorUnableToCreateXWindow 442 +#define MGK_ResourceLimitErrorUnableToCropImage 443 +#define MGK_ResourceLimitErrorUnableToDespeckleImage 444 +#define MGK_ResourceLimitErrorUnableToDetermineImageClass 445 +#define MGK_ResourceLimitErrorUnableToDetermineTheNumberOfImageColors 446 +#define MGK_ResourceLimitErrorUnableToDitherImage 447 +#define MGK_ResourceLimitErrorUnableToDrawOnImage 448 +#define MGK_ResourceLimitErrorUnableToEdgeImage 449 +#define MGK_ResourceLimitErrorUnableToEmbossImage 450 +#define MGK_ResourceLimitErrorUnableToEnhanceImage 451 +#define MGK_ResourceLimitErrorUnableToFloodfillImage 452 +#define MGK_ResourceLimitErrorUnableToGammaCorrectImage 453 +#define MGK_ResourceLimitErrorUnableToGetBestIconSize 454 +#define MGK_ResourceLimitErrorUnableToGetFromRegistry 455 +#define MGK_ResourceLimitErrorUnableToGetPackageInfo 456 +#define MGK_ResourceLimitErrorUnableToInterpretMSLImage 457 +#define MGK_ResourceLimitErrorUnableToLevelImage 458 +#define MGK_ResourceLimitErrorUnableToMagnifyImage 459 +#define MGK_ResourceLimitErrorUnableToManageColor 460 +#define MGK_ResourceLimitErrorUnableToMapImage 461 +#define MGK_ResourceLimitErrorUnableToMapImageSequence 462 +#define MGK_ResourceLimitErrorUnableToMedianFilterImage 463 +#define MGK_ResourceLimitErrorUnableToMotionBlurImage 464 +#define MGK_ResourceLimitErrorUnableToNoiseFilterImage 465 +#define MGK_ResourceLimitErrorUnableToNormalizeImage 466 +#define MGK_ResourceLimitErrorUnableToOpenColorProfile 467 +#define MGK_ResourceLimitErrorUnableToQuantizeImage 468 +#define MGK_ResourceLimitErrorUnableToQuantizeImageSequence 469 +#define MGK_ResourceLimitErrorUnableToReadTextChunk 470 +#define MGK_ResourceLimitErrorUnableToReadXImage 471 +#define MGK_ResourceLimitErrorUnableToReadXServerColormap 472 +#define MGK_ResourceLimitErrorUnableToResizeImage 473 +#define MGK_ResourceLimitErrorUnableToRotateImage 474 +#define MGK_ResourceLimitErrorUnableToSampleImage 475 +#define MGK_ResourceLimitErrorUnableToScaleImage 476 +#define MGK_ResourceLimitErrorUnableToSelectImage 477 +#define MGK_ResourceLimitErrorUnableToSharpenImage 478 +#define MGK_ResourceLimitErrorUnableToShaveImage 479 +#define MGK_ResourceLimitErrorUnableToShearImage 480 +#define MGK_ResourceLimitErrorUnableToSortImageColormap 481 +#define MGK_ResourceLimitErrorUnableToThresholdImage 482 +#define MGK_ResourceLimitErrorUnableToTransformColorspace 483 +#define MGK_ResourceLimitFatalErrorMemoryAllocationFailed 484 +#define MGK_ResourceLimitFatalErrorSemaporeOperationFailed 485 +#define MGK_ResourceLimitFatalErrorUnableToAllocateAscii85Info 486 +#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheInfo 487 +#define MGK_ResourceLimitFatalErrorUnableToAllocateCacheView 488 +#define MGK_ResourceLimitFatalErrorUnableToAllocateColorInfo 489 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDashPattern 490 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDelegateInfo 491 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDerivatives 492 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawContext 493 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawInfo 494 +#define MGK_ResourceLimitFatalErrorUnableToAllocateDrawingWand 495 +#define MGK_ResourceLimitFatalErrorUnableToAllocateGammaMap 496 +#define MGK_ResourceLimitFatalErrorUnableToAllocateImage 497 +#define MGK_ResourceLimitFatalErrorUnableToAllocateImagePixels 498 +#define MGK_ResourceLimitFatalErrorUnableToAllocateLogInfo 499 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagicInfo 500 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickInfo 501 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMagickMap 502 +#define MGK_ResourceLimitFatalErrorUnableToAllocateModuleInfo 503 +#define MGK_ResourceLimitFatalErrorUnableToAllocateMontageInfo 504 +#define MGK_ResourceLimitFatalErrorUnableToAllocateQuantizeInfo 505 +#define MGK_ResourceLimitFatalErrorUnableToAllocateRandomKernel 506 +#define MGK_ResourceLimitFatalErrorUnableToAllocateRegistryInfo 507 +#define MGK_ResourceLimitFatalErrorUnableToAllocateSemaphoreInfo 508 +#define MGK_ResourceLimitFatalErrorUnableToAllocateString 509 +#define MGK_ResourceLimitFatalErrorUnableToAllocateTypeInfo 510 +#define MGK_ResourceLimitFatalErrorUnableToAllocateWand 511 +#define MGK_ResourceLimitFatalErrorUnableToAnimateImageSequence 512 +#define MGK_ResourceLimitFatalErrorUnableToCloneBlobInfo 513 +#define MGK_ResourceLimitFatalErrorUnableToCloneCacheInfo 514 +#define MGK_ResourceLimitFatalErrorUnableToCloneImage 515 +#define MGK_ResourceLimitFatalErrorUnableToCloneImageInfo 516 +#define MGK_ResourceLimitFatalErrorUnableToConcatenateString 517 +#define MGK_ResourceLimitFatalErrorUnableToConvertText 518 +#define MGK_ResourceLimitFatalErrorUnableToCreateColormap 519 +#define MGK_ResourceLimitFatalErrorUnableToDestroySemaphore 520 +#define MGK_ResourceLimitFatalErrorUnableToDisplayImage 521 +#define MGK_ResourceLimitFatalErrorUnableToEscapeString 522 +#define MGK_ResourceLimitFatalErrorUnableToInitializeSemaphore 523 +#define MGK_ResourceLimitFatalErrorUnableToInterpretMSLImage 524 +#define MGK_ResourceLimitFatalErrorUnableToLockSemaphore 525 +#define MGK_ResourceLimitFatalErrorUnableToObtainRandomEntropy 526 +#define MGK_ResourceLimitFatalErrorUnableToUnlockSemaphore 527 +#define MGK_ResourceLimitWarningMemoryAllocationFailed 528 +#define MGK_StreamErrorImageDoesNotContainTheStreamGeometry 529 +#define MGK_StreamErrorNoStreamHandlerIsDefined 530 +#define MGK_StreamErrorPixelCacheIsNotOpen 531 +#define MGK_StreamErrorUnableToAcquirePixelStream 532 +#define MGK_StreamErrorUnableToSetPixelStream 533 +#define MGK_StreamErrorUnableToSyncPixelStream 534 +#define MGK_StreamFatalErrorDefault 535 +#define MGK_StreamWarningDefault 536 +#define MGK_TypeErrorFontNotSpecified 537 +#define MGK_TypeErrorFontSubstitutionRequired 538 +#define MGK_TypeErrorUnableToGetTypeMetrics 539 +#define MGK_TypeErrorUnableToInitializeFreetypeLibrary 540 +#define MGK_TypeErrorUnableToReadFont 541 +#define MGK_TypeErrorUnrecognizedFontEncoding 542 +#define MGK_TypeFatalErrorDefault 543 +#define MGK_TypeWarningDefault 544 +#define MGK_WandErrorInvalidColormapIndex 545 +#define MGK_WandErrorWandAPINotImplemented 546 +#define MGK_WandErrorWandContainsNoImageIndexs 547 +#define MGK_WandErrorWandContainsNoImages 548 +#define MGK_XServerErrorColorIsNotKnownToServer 549 +#define MGK_XServerErrorNoWindowWithSpecifiedIDExists 550 +#define MGK_XServerErrorStandardColormapIsNotInitialized 551 +#define MGK_XServerErrorUnableToConnectToRemoteDisplay 552 +#define MGK_XServerErrorUnableToCreateBitmap 553 +#define MGK_XServerErrorUnableToCreateColormap 554 +#define MGK_XServerErrorUnableToCreatePixmap 555 +#define MGK_XServerErrorUnableToCreateProperty 556 +#define MGK_XServerErrorUnableToCreateStandardColormap 557 +#define MGK_XServerErrorUnableToDisplayImageInfo 558 +#define MGK_XServerErrorUnableToGetProperty 559 +#define MGK_XServerErrorUnableToGetStandardColormap 560 +#define MGK_XServerErrorUnableToGetVisual 561 +#define MGK_XServerErrorUnableToGrabMouse 562 +#define MGK_XServerErrorUnableToLoadFont 563 +#define MGK_XServerErrorUnableToMatchVisualToStandardColormap 564 +#define MGK_XServerErrorUnableToOpenXServer 565 +#define MGK_XServerErrorUnableToReadXAttributes 566 +#define MGK_XServerErrorUnableToReadXWindowImage 567 +#define MGK_XServerErrorUnrecognizedColormapType 568 +#define MGK_XServerErrorUnrecognizedGravityType 569 +#define MGK_XServerErrorUnrecognizedVisualSpecifier 570 +#define MGK_XServerFatalErrorUnableToAllocateXHints 571 +#define MGK_XServerFatalErrorUnableToCreateCursor 572 +#define MGK_XServerFatalErrorUnableToCreateGraphicContext 573 +#define MGK_XServerFatalErrorUnableToCreateStandardColormap 574 +#define MGK_XServerFatalErrorUnableToCreateTextProperty 575 +#define MGK_XServerFatalErrorUnableToCreateXImage 576 +#define MGK_XServerFatalErrorUnableToCreateXPixmap 577 +#define MGK_XServerFatalErrorUnableToCreateXWindow 578 +#define MGK_XServerFatalErrorUnableToDisplayImage 579 +#define MGK_XServerFatalErrorUnableToDitherImage 580 +#define MGK_XServerFatalErrorUnableToGetPixelInfo 581 +#define MGK_XServerFatalErrorUnableToGetVisual 582 +#define MGK_XServerFatalErrorUnableToLoadFont 583 +#define MGK_XServerFatalErrorUnableToMakeXWindow 584 +#define MGK_XServerFatalErrorUnableToOpenXServer 585 +#define MGK_XServerFatalErrorUnableToViewFonts 586 +#define MGK_XServerWarningUnableToGetVisual 587 +#define MGK_XServerWarningUsingDefaultVisual 588 #endif @@ -652,43 +655,43 @@ static const SeverityInfo severity_map[] = { "Delegate/FatalError", 199, DelegateFatalError }, { "Delegate/Warning", 200, DelegateWarning }, { "Draw/Error", 201, DrawError }, - { "Draw/FatalError", 217, DrawFatalError }, - { "Draw/Warning", 218, DrawWarning }, - { "File/Open/Error", 221, FileOpenError }, - { "File/Open/FatalError", 224, FileOpenFatalError }, - { "File/Open/Warning", 225, FileOpenWarning }, - { "Image/Error", 226, ImageError }, - { "Image/FatalError", 263, ImageFatalError }, - { "Image/Warning", 264, ImageWarning }, - { "Missing/Delegate/Error", 265, MissingDelegateError }, - { "Missing/Delegate/FatalError", 277, MissingDelegateFatalError }, - { "Missing/Delegate/Warning", 278, MissingDelegateWarning }, - { "Module/Error", 279, ModuleError }, - { "Module/FatalError", 284, ModuleFatalError }, - { "Module/Warning", 285, ModuleWarning }, - { "Monitor/Error", 286, MonitorError }, - { "Monitor/FatalError", 287, MonitorFatalError }, - { "Monitor/Warning", 289, MonitorWarning }, - { "Option/Error", 290, OptionError }, - { "Option/FatalError", 376, OptionFatalError }, - { "Option/Warning", 398, OptionWarning }, - { "Registry/Error", 399, RegistryError }, - { "Registry/FatalError", 405, RegistryFatalError }, - { "Registry/Warning", 406, RegistryWarning }, - { "Resource/Limit/Error", 407, ResourceLimitError }, - { "Resource/Limit/FatalError", 480, ResourceLimitFatalError }, - { "Resource/Limit/Warning", 524, ResourceLimitWarning }, - { "Stream/Error", 525, StreamError }, - { "Stream/FatalError", 531, StreamFatalError }, - { "Stream/Warning", 532, StreamWarning }, - { "Type/Error", 533, TypeError }, - { "Type/FatalError", 539, TypeFatalError }, - { "Type/Warning", 540, TypeWarning }, - { "Wand/Error", 541, WandError }, - { "XServer/Error", 545, XServerError }, - { "XServer/FatalError", 567, XServerFatalError }, - { "XServer/Warning", 583, XServerWarning }, - { "", 585, UndefinedException } + { "Draw/FatalError", 218, DrawFatalError }, + { "Draw/Warning", 219, DrawWarning }, + { "File/Open/Error", 222, FileOpenError }, + { "File/Open/FatalError", 225, FileOpenFatalError }, + { "File/Open/Warning", 226, FileOpenWarning }, + { "Image/Error", 227, ImageError }, + { "Image/FatalError", 264, ImageFatalError }, + { "Image/Warning", 265, ImageWarning }, + { "Missing/Delegate/Error", 266, MissingDelegateError }, + { "Missing/Delegate/FatalError", 278, MissingDelegateFatalError }, + { "Missing/Delegate/Warning", 279, MissingDelegateWarning }, + { "Module/Error", 280, ModuleError }, + { "Module/FatalError", 285, ModuleFatalError }, + { "Module/Warning", 286, ModuleWarning }, + { "Monitor/Error", 287, MonitorError }, + { "Monitor/FatalError", 288, MonitorFatalError }, + { "Monitor/Warning", 290, MonitorWarning }, + { "Option/Error", 291, OptionError }, + { "Option/FatalError", 377, OptionFatalError }, + { "Option/Warning", 399, OptionWarning }, + { "Registry/Error", 400, RegistryError }, + { "Registry/FatalError", 406, RegistryFatalError }, + { "Registry/Warning", 407, RegistryWarning }, + { "Resource/Limit/Error", 408, ResourceLimitError }, + { "Resource/Limit/FatalError", 483, ResourceLimitFatalError }, + { "Resource/Limit/Warning", 527, ResourceLimitWarning }, + { "Stream/Error", 528, StreamError }, + { "Stream/FatalError", 534, StreamFatalError }, + { "Stream/Warning", 535, StreamWarning }, + { "Type/Error", 536, TypeError }, + { "Type/FatalError", 542, TypeFatalError }, + { "Type/Warning", 543, TypeWarning }, + { "Wand/Error", 544, WandError }, + { "XServer/Error", 548, XServerError }, + { "XServer/FatalError", 570, XServerFatalError }, + { "XServer/Warning", 586, XServerWarning }, + { "", 588, UndefinedException } }; #endif @@ -915,6 +918,7 @@ static const MessageInfo message_map[] = { "UnableToPrint", MGK_DrawErrorUnableToPrint }, { "UnbalancedGraphicContextPushPop", MGK_DrawErrorUnbalancedGraphicContextPushPop }, { "UnbalancedPushPop", MGK_DrawErrorUnbalancedPushPop }, + { "UnreasonableAffineMatrix", MGK_DrawErrorUnreasonableAffineMatrix }, { "UnreasonableDashPolygonLength", MGK_DrawErrorUnreasonableDashPolygonLength }, { "UnreasonableGradientSize", MGK_DrawErrorUnreasonableGradientSize }, { "VectorPathTruncated", MGK_DrawErrorVectorPathTruncated }, @@ -1118,6 +1122,7 @@ static const MessageInfo message_map[] = { "NexusPixelWidthLimitExceeded", MGK_ResourceLimitErrorNexusPixelWidthLimitExceeded }, { "NoPixelsDefinedInCache", MGK_ResourceLimitErrorNoPixelsDefinedInCache }, { "PixelCacheAllocationFailed", MGK_ResourceLimitErrorPixelCacheAllocationFailed }, + { "ReadLimitExceeded", MGK_ResourceLimitErrorReadLimitExceeded }, { "UnableToAddColorProfile", MGK_ResourceLimitErrorUnableToAddColorProfile }, { "UnableToAddGenericProfile", MGK_ResourceLimitErrorUnableToAddGenericProfile }, { "UnableToAddIPTCProfile", MGK_ResourceLimitErrorUnableToAddIPTCProfile }, @@ -1155,6 +1160,7 @@ static const MessageInfo message_map[] = { "UnableToGetBestIconSize", MGK_ResourceLimitErrorUnableToGetBestIconSize }, { "UnableToGetFromRegistry", MGK_ResourceLimitErrorUnableToGetFromRegistry }, { "UnableToGetPackageInfo", MGK_ResourceLimitErrorUnableToGetPackageInfo }, + { "UnableToInterpretMSLImage", MGK_ResourceLimitErrorUnableToInterpretMSLImage }, { "UnableToLevelImage", MGK_ResourceLimitErrorUnableToLevelImage }, { "UnableToMagnifyImage", MGK_ResourceLimitErrorUnableToMagnifyImage }, { "UnableToManageColor", MGK_ResourceLimitErrorUnableToManageColor }, @@ -1507,6 +1513,7 @@ static const char message_dat[] = "Unable to print\0" "unbalanced graphic context push-pop\0" "unbalanced push-pop\0" + "unreasonable affine matrix\0" "unreasonable dash polygon length\0" "unreasonable gradient image size\0" "vector path truncated\0" @@ -1524,7 +1531,7 @@ static const char message_dat[] = "Colorspace color profile mismatch\0" "image colorspace differs\0" "image colorspace mismatch\0" - "image difference exceeds limit (%s)\0" + "image difference exceeds limit\0" "image does not contain resolution\0" "image is not colormapped\0" "image opacity differs\0" @@ -1710,6 +1717,7 @@ static const char message_dat[] = "Pixel nexus width limit exceeded (see -limit Width)\0" "No pixels defined in cache\0" "Pixel cache allocation failed\0" + "Read limit exceeded (see -limit Read)\0" "unable to add ICC Color profile\0" "unable to add generic profile\0" "unable to add IPTC profile\0" @@ -1747,6 +1755,7 @@ static const char message_dat[] = "unable to get best icon size\0" "unable to get from registry\0" "Unable to get package info\0" + "unable to interpret MSL image\0" "unable to level image\0" "unable to magnify image\0" "Unable to manage color\0" @@ -2098,377 +2107,380 @@ static const unsigned short message_dat_offsets[] = 6459, 6495, 6515, - 6548, - 6581, - 6603, - 6617, - 6636, - 6677, - 6691, - 6723, - 6743, - 6764, - 6778, - 6794, - 6817, - 6862, - 6896, - 6921, - 6947, - 6983, - 7017, - 7042, + 6542, + 6575, + 6608, + 6630, + 6644, + 6663, + 6704, + 6718, + 6750, + 6770, + 6791, + 6805, + 6821, + 6844, + 6889, + 6923, + 6948, + 6974, + 7005, + 7039, 7064, - 7091, - 7110, - 7133, - 7167, - 7188, + 7086, + 7113, + 7132, + 7155, + 7189, 7210, - 7238, - 7255, - 7278, - 7303, - 7327, - 7352, - 7377, - 7407, - 7437, - 7474, - 7504, - 7528, - 7552, - 7581, - 7612, - 7642, - 7665, - 7689, - 7713, - 7742, + 7232, + 7260, + 7277, + 7300, + 7325, + 7349, + 7374, + 7399, + 7429, + 7459, + 7496, + 7526, + 7550, + 7574, + 7603, + 7634, + 7664, + 7687, + 7711, + 7735, 7764, - 7794, + 7786, 7816, - 7832, - 7861, - 7890, - 7924, - 7966, - 7992, - 8017, - 8058, - 8099, - 8129, - 8158, - 8192, - 8234, - 8248, - 8264, - 8287, + 7838, + 7854, + 7883, + 7912, + 7946, + 7988, + 8014, + 8039, + 8080, + 8121, + 8151, + 8180, + 8214, + 8256, + 8270, + 8286, 8309, 8331, - 8363, - 8383, - 8418, - 8434, - 8448, - 8462, - 8502, - 8518, - 8542, - 8573, - 8603, - 8632, - 8664, - 8703, - 8732, - 8761, - 8793, - 8819, - 8850, - 8881, - 8912, - 8939, - 8974, - 9009, - 9037, - 9063, - 9121, - 9147, - 9171, - 9203, - 9221, - 9256, - 9282, - 9301, - 9326, - 9351, - 9392, - 9424, - 9447, + 8353, + 8385, + 8405, + 8440, + 8456, + 8470, + 8484, + 8524, + 8540, + 8564, + 8595, + 8625, + 8654, + 8686, + 8725, + 8754, + 8783, + 8815, + 8841, + 8872, + 8903, + 8934, + 8961, + 8996, + 9031, + 9059, + 9085, + 9143, + 9169, + 9193, + 9225, + 9243, + 9278, + 9304, + 9323, + 9348, + 9373, + 9414, + 9446, 9469, - 9510, - 9550, - 9582, - 9615, - 9636, - 9657, - 9686, - 9713, - 9738, - 9759, - 9784, - 9807, - 9840, + 9491, + 9532, + 9572, + 9604, + 9637, + 9658, + 9679, + 9708, + 9735, + 9760, + 9781, + 9806, + 9829, 9862, - 9888, + 9884, 9910, 9932, - 9956, - 9982, - 10003, - 10026, - 10052, - 10071, - 10098, - 10128, - 10200, - 10230, - 10258, - 10279, - 10304, - 10330, - 10359, - 10390, - 10416, - 10442, - 10466, - 10490, - 10515, - 10543, - 10566, - 10592, - 10615, - 10639, + 9954, + 9978, + 10004, + 10025, + 10048, + 10074, + 10093, + 10120, + 10150, + 10222, + 10252, + 10280, + 10301, + 10326, + 10352, + 10381, + 10412, + 10438, + 10464, + 10488, + 10512, + 10537, + 10565, + 10588, + 10614, + 10637, 10661, - 10681, - 10712, - 10735, - 10761, - 10788, - 10806, - 10830, - 10864, - 10892, - 10939, - 10963, - 10983, - 11002, - 11025, - 11051, - 11109, + 10683, + 10703, + 10734, + 10757, + 10783, + 10810, + 10828, + 10852, + 10886, + 10914, + 10961, + 10985, + 11005, + 11024, + 11047, + 11073, 11131, - 11159, - 11191, - 11214, + 11153, + 11181, + 11213, 11236, - 11263, - 11292, - 11320, - 11345, - 11370, - 11400, - 11424, - 11452, - 11472, - 11499, - 11533, - 11552, - 11567, - 11587, - 11611, - 11637, - 11660, - 11683, - 11697, - 11713, - 11757, - 11811, - 11858, - 11910, - 11935, - 11989, - 12036, - 12088, - 12115, - 12145, - 12177, - 12207, - 12234, - 12266, - 12298, + 11258, + 11285, + 11314, + 11342, + 11367, + 11392, + 11422, + 11446, + 11474, + 11494, + 11521, + 11555, + 11574, + 11589, + 11609, + 11633, + 11659, + 11682, + 11705, + 11719, + 11735, + 11779, + 11833, + 11880, + 11932, + 11957, + 12011, + 12058, + 12110, + 12137, + 12167, + 12205, + 12237, + 12267, + 12294, 12326, - 12357, - 12382, - 12408, - 12433, - 12466, - 12495, - 12517, - 12551, - 12578, - 12601, - 12637, - 12663, - 12696, - 12728, - 12757, + 12358, + 12386, + 12417, + 12442, + 12468, + 12493, + 12526, + 12555, + 12577, + 12611, + 12638, + 12661, + 12697, + 12723, + 12756, 12788, - 12814, - 12835, - 12861, - 12893, - 12940, - 12963, - 12987, - 13008, - 13031, - 13055, - 13081, - 13111, - 13140, - 13168, - 13195, - 13217, - 13241, - 13264, - 13284, - 13313, - 13343, - 13371, - 13400, - 13426, - 13455, - 13480, - 13514, - 13540, - 13563, - 13596, - 13619, - 13642, - 13665, - 13687, - 13710, - 13734, - 13756, - 13778, - 13808, - 13834, - 13865, - 13890, - 13917, - 13949, - 13979, - 14009, + 12817, + 12848, + 12874, + 12895, + 12921, + 12953, + 13000, + 13023, + 13047, + 13068, + 13091, + 13115, + 13141, + 13171, + 13200, + 13228, + 13255, + 13285, + 13307, + 13331, + 13354, + 13374, + 13403, + 13433, + 13461, + 13490, + 13516, + 13545, + 13570, + 13604, + 13630, + 13653, + 13686, + 13709, + 13732, + 13755, + 13777, + 13800, + 13824, + 13846, + 13868, + 13898, + 13924, + 13955, + 13980, + 14007, 14039, - 14071, - 14104, - 14133, - 14165, + 14069, + 14099, + 14129, + 14161, 14194, - 14226, + 14223, 14255, - 14280, - 14312, - 14340, + 14284, + 14316, + 14345, 14370, - 14401, - 14431, - 14462, - 14494, - 14527, - 14560, - 14593, - 14627, - 14653, - 14682, - 14706, - 14739, - 14765, - 14792, - 14814, - 14841, - 14870, - 14893, - 14919, - 14947, - 14971, - 14995, - 15026, - 15056, - 15081, - 15133, - 15160, - 15185, - 15228, - 15257, - 15281, - 15312, - 15339, - 15367, - 15381, - 15397, - 15421, - 15448, - 15475, - 15513, - 15533, - 15560, - 15574, - 15590, - 15622, - 15656, - 15696, - 15729, - 15758, - 15793, - 15830, - 15866, - 15890, - 15916, - 15940, - 15966, - 16001, + 14402, + 14430, + 14460, + 14491, + 14521, + 14552, + 14584, + 14617, + 14650, + 14683, + 14717, + 14743, + 14772, + 14796, + 14829, + 14855, + 14882, + 14904, + 14931, + 14960, + 14983, + 15009, + 15037, + 15061, + 15085, + 15116, + 15146, + 15171, + 15223, + 15250, + 15275, + 15318, + 15347, + 15371, + 15402, + 15429, + 15457, + 15471, + 15487, + 15511, + 15538, + 15565, + 15603, + 15623, + 15650, + 15664, + 15680, + 15712, + 15746, + 15786, + 15819, + 15848, + 15883, + 15920, + 15956, + 15980, + 16006, 16030, - 16053, - 16085, - 16106, - 16127, - 16147, - 16191, - 16215, - 16243, - 16273, - 16300, - 16326, - 16356, - 16383, - 16409, - 16442, - 16477, - 16508, - 16533, - 16559, - 16585, - 16609, - 16632, - 16657, - 16678, - 16698, + 16056, + 16091, + 16120, + 16143, + 16175, + 16196, + 16217, + 16237, + 16281, + 16305, + 16333, + 16363, + 16390, + 16416, + 16446, + 16473, + 16499, + 16532, + 16567, + 16598, + 16623, + 16649, + 16675, + 16699, 16722, - 16746, - 16767, + 16747, + 16768, 16788, - 16807, + 16812, + 16836, + 16857, + 16878, + 16897, 0 }; #endif /* if defined(_INCLUDE_MESSAGE_TABLE_) */ diff --git a/magick/magic.c b/magick/magic.c index 0a7f93f..bb0594f 100644 --- a/magick/magic.c +++ b/magick/magic.c @@ -60,6 +60,7 @@ StaticMagic[] = { #define MAGIC(name,offset,magic) {name,(const unsigned char * const)magic,sizeof(magic)-1,offset} MAGIC("WEBP", 8, "WEBP"), + MAGIC("AVIF", 4, "ftypavif"), /* MAGIC("AVI", 0, "RIFF"), */ MAGIC("8BIMWTEXT", 0, "8\000B\000I\000M\000#"), MAGIC("8BIMTEXT", 0, "8BIM#"), @@ -90,6 +91,9 @@ StaticMagic[] = MAGIC("FITS", 0, "SIMPLE"), MAGIC("FPX", 0, "\320\317\021\340"), MAGIC("GIF", 0, "GIF8"), + MAGIC("HEIC", 4, "ftypheic"), + MAGIC("HEIC", 4, "ftypheix"), + MAGIC("HEIC", 4, "ftypmif1"), MAGIC("HDF", 1, "HDF"), MAGIC("HPGL", 0, "IN;"), MAGIC("HTML", 1, "HTML"), diff --git a/magick/magick_config.h.in b/magick/magick_config.h.in index e5e1a2f..a6f229a 100644 --- a/magick/magick_config.h.in +++ b/magick/magick_config.h.in @@ -146,6 +146,9 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `jas_init_library' function. */ +#undef HAVE_JAS_INIT_LIBRARY + /* Define if you have the <lcms2.h> header file. */ #undef HAVE_LCMS2_H @@ -390,6 +393,12 @@ /* Define to 1 if you have the <wincrypt.h> header file. */ #undef HAVE_WINCRYPT_H +/* Define to 1 if you have the `xmlNanoFTPNewCtxt' function. */ +#undef HAVE_XMLNANOFTPNEWCTXT + +/* Define to 1 if you have the `xmlNanoHTTPOpen' function. */ +#undef HAVE_XMLNANOHTTPOPEN + /* Define to 1 if you have the `_exit' function. */ #undef HAVE__EXIT @@ -414,6 +423,9 @@ /* Enable use of Ghostscript */ #undef HasGS +/* Define if you have HEIF library */ +#undef HasHEIF + /* Define if you have JBIG library */ #undef HasJBIG @@ -423,6 +435,9 @@ /* Define if you have JPEG library */ #undef HasJPEG +/* Define if you have JXL library */ +#undef HasJXL + /* Define if you have LCMS (v2.0 or later) library */ #undef HasLCMS diff --git a/magick/magick_types.h b/magick/magick_types.h index 30df6a0..bb17db8 100644 --- a/magick/magick_types.h +++ b/magick/magick_types.h @@ -49,6 +49,22 @@ extern "C" { IEEE Std 1003.1 (1990), 2004 types. Not part of ANSI C! ssize_t -- signed type for a count of bytes or an error indication ("%zd") ? to SSIZE_MAX + Useful inttypes.h "printf" formatters: + + magick_int8_t PRId8 + magick_uint8_t PRIu8 + magick_int16_t PRId16 + magick_uint16_t PRIu16 + magick_int32_t PRId32 + magick_uint32_t PRIu32 + magick_int64_t PRId64 + magick_uint64_t PRIu64 + magick_uintmax_t ju + magick_uintptr_t tu + size_t zu + ptrdiff_t td + ssize_t zd? + */ #if (defined(WIN32) || defined(WIN64)) && \ @@ -63,14 +79,17 @@ extern "C" { typedef unsigned short magick_uint16_t; typedef signed int magick_int32_t; -# define MAGICK_INT32_F "" typedef unsigned int magick_uint32_t; -# define MAGICK_UINT32_F "" typedef signed __int64 magick_int64_t; -# define MAGICK_INT64_F "I64" typedef unsigned __int64 magick_uint64_t; -# define MAGICK_UINT64_F "I64" + +# if defined(MAGICK_IMPLEMENTATION) + +# define MAGICK_INT32_F "" +# define MAGICK_UINT32_F "" +# define MAGICK_INT64_F "I64" +# define MAGICK_UINT64_F "I64" typedef magick_uint64_t magick_uintmax_t; @@ -89,6 +108,8 @@ extern "C" { # define MAGICK_SSIZE_T long # endif // defined(WIN64) +#endif /* if defined(MAGICK_IMPLEMENTATION) */ + #else /* The following typedefs are subtituted when using Unixish configure */ @@ -99,13 +120,16 @@ extern "C" { typedef unsigned short magick_uint16_t; typedef signed int magick_int32_t; -# define MAGICK_INT32_F "" typedef unsigned int magick_uint32_t; -# define MAGICK_UINT32_F "" typedef signed long magick_int64_t; -# define MAGICK_INT64_F "l" typedef unsigned long magick_uint64_t; + +# if defined(MAGICK_IMPLEMENTATION) + +# define MAGICK_INT32_F "" +# define MAGICK_UINT32_F "" +# define MAGICK_INT64_F "l" # define MAGICK_UINT64_F "l" typedef unsigned long magick_uintmax_t; @@ -120,11 +144,16 @@ extern "C" { # define MAGICK_SSIZE_T_F "l" # define MAGICK_SSIZE_T signed long +#endif /* defined(MAGICK_IMPLEMENTATION) */ + #endif /* 64-bit file and blob offset type */ typedef magick_int64_t magick_off_t; -#define MAGICK_OFF_F MAGICK_INT64_F + +#if defined(MAGICK_IMPLEMENTATION) +# define MAGICK_OFF_F MAGICK_INT64_F +#endif /* defined(MAGICK_IMPLEMENTATION) */ #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/magick_types.h.in b/magick/magick_types.h.in index 7982b5d..78e6fa5 100644 --- a/magick/magick_types.h.in +++ b/magick/magick_types.h.in @@ -49,6 +49,22 @@ extern "C" { IEEE Std 1003.1 (1990), 2004 types. Not part of ANSI C! ssize_t -- signed type for a count of bytes or an error indication ("%zd") ? to SSIZE_MAX + Useful inttypes.h "printf" formatters: + + magick_int8_t PRId8 + magick_uint8_t PRIu8 + magick_int16_t PRId16 + magick_uint16_t PRIu16 + magick_int32_t PRId32 + magick_uint32_t PRIu32 + magick_int64_t PRId64 + magick_uint64_t PRIu64 + magick_uintmax_t ju + magick_uintptr_t tu + size_t zu + ptrdiff_t td + ssize_t zd? + */ #if (defined(WIN32) || defined(WIN64)) && \ @@ -63,14 +79,17 @@ extern "C" { typedef unsigned short magick_uint16_t; typedef signed int magick_int32_t; -# define MAGICK_INT32_F "" typedef unsigned int magick_uint32_t; -# define MAGICK_UINT32_F "" typedef signed __int64 magick_int64_t; -# define MAGICK_INT64_F "I64" typedef unsigned __int64 magick_uint64_t; -# define MAGICK_UINT64_F "I64" + +# if defined(MAGICK_IMPLEMENTATION) + +# define MAGICK_INT32_F "" +# define MAGICK_UINT32_F "" +# define MAGICK_INT64_F "I64" +# define MAGICK_UINT64_F "I64" typedef magick_uint64_t magick_uintmax_t; @@ -89,6 +108,8 @@ extern "C" { # define MAGICK_SSIZE_T long # endif // defined(WIN64) +#endif /* if defined(MAGICK_IMPLEMENTATION) */ + #else /* The following typedefs are subtituted when using Unixish configure */ @@ -99,13 +120,16 @@ extern "C" { typedef @UINT16_T@ magick_uint16_t; typedef @INT32_T@ magick_int32_t; -# define MAGICK_INT32_F @INT32_F@ typedef @UINT32_T@ magick_uint32_t; -# define MAGICK_UINT32_F @UINT32_F@ typedef @INT64_T@ magick_int64_t; -# define MAGICK_INT64_F @INT64_F@ typedef @UINT64_T@ magick_uint64_t; + +# if defined(MAGICK_IMPLEMENTATION) + +# define MAGICK_INT32_F @INT32_F@ +# define MAGICK_UINT32_F @UINT32_F@ +# define MAGICK_INT64_F @INT64_F@ # define MAGICK_UINT64_F @UINT64_F@ typedef @UINTMAX_T@ magick_uintmax_t; @@ -120,11 +144,16 @@ extern "C" { # define MAGICK_SSIZE_T_F @MAGICK_SSIZE_T_F@ # define MAGICK_SSIZE_T @MAGICK_SSIZE_T@ +#endif /* defined(MAGICK_IMPLEMENTATION) */ + #endif /* 64-bit file and blob offset type */ typedef magick_int64_t magick_off_t; -#define MAGICK_OFF_F MAGICK_INT64_F + +#if defined(MAGICK_IMPLEMENTATION) +# define MAGICK_OFF_F MAGICK_INT64_F +#endif /* defined(MAGICK_IMPLEMENTATION) */ #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/map.c b/magick/map.c index 2626675..fac9689 100644 --- a/magick/map.c +++ b/magick/map.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2017 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % % This program is covered by multiple licenses, which are described in % Copyright.txt. You should have received a copy of Copyright.txt with this @@ -1086,7 +1086,17 @@ MagickMapCopyString(const void *string, const size_t size) { ARG_NOT_USED(size); if (string) - return (void *) AcquireString((const char *)string); + { + size_t length = strlen(string); + char *dstring=MagickAllocateMemory(char *,length+1); + if (dstring != (char *) NULL) + { + if (length != 0) + (void) memcpy(dstring,string,length); + dstring[length]='\0'; + } + return dstring; + } return 0; } @@ -1114,7 +1124,7 @@ MagickMapCopyString(const void *string, const size_t size) % o string: pointer to string data to deallocate % */ -extern MagickExport void +MagickExport void MagickMapDeallocateString(void *string) { MagickFreeMemory(string); @@ -1186,8 +1196,158 @@ MagickMapCopyBlob(const void *blob, const size_t size) % o blob: pointer to BLOB data to deallocate % */ -extern MagickExport void +MagickExport void MagickMapDeallocateBlob(void *blob) { MagickFreeMemory(blob); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c k M a p C o p y R e s o u r c e L i m i t e d S t r i n g % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickMapCopyResourceLimitedString() copies a string using the +% resource-limited memory allocator. It is intended for use as the clone +% function for strings so that C strings may easily be stored in a map. +% +% The format of the MagickMapCopyResourceLimitedString method is: +% +% void *MagickMapCopyResourceLimitedString(const void *string, const size_t size) +% +% A description of each parameter follows: +% +% o string: pointer to string data +% +% o size: ignored by this method. +% +*/ +MagickExport void * +MagickMapCopyResourceLimitedString(const void *string, const size_t size) +{ + ARG_NOT_USED(size); + if (string) + { + size_t length = strlen(string); + char *dstring=MagickAllocateResourceLimitedMemory(char *,length+1); + if (dstring != (char *) NULL) + { + if (length != 0) + (void) memcpy(dstring,string,length); + dstring[length]='\0'; + } + return dstring; + } + return 0; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c k M a p D e a l l o c a t e R e s o u r c e L i m i t e d S t r i n g % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickMapDeallocateResourceLimitedString() deallocates a string allocated +% using the resource-limited memory allocator. It is intended for +% use as the deallocate function for strings so that C strings may easily +% be stored in a map. +% +% The format of the MagickMapDeallocateResourceLimitedString method is: +% +% void MagickMapDeallocateResourceLimitedString(void *string) +% +% A description of each parameter follows: +% +% o string: pointer to string data to deallocate +% +*/ +MagickExport void +MagickMapDeallocateResourceLimitedString(void *string) +{ + MagickFreeResourceLimitedMemory(string); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c k M a p C o p y R e s o u r c e L i m i t e d B l o b % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickMapCopyResourceLimitedBlob() copies a BLOB using the +% resource-limited memory allocator. It is intended for use as the +% clone function for BLOBs so that BLOB may easily be stored in +% a map. +% +% The format of the MagickMapCopyResourceLimitedBlob method is: +% +% void *MagickMapCopyResourceLimitedBlob(const void *blob, const size_t size) +% +% A description of each parameter follows: +% +% o blob: pointer to BLOB data +% +% o size: BLOB size +% +*/ +MagickExport void * +MagickMapCopyResourceLimitedBlob(const void *blob, const size_t size) +{ + if (blob) + { + void + *memory; + + memory=MagickAllocateResourceLimitedMemory(void *,size); + if (memory) + (void) memcpy(memory,blob,size); + return (memory); + } + return 0; +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c k M a p D e a l l o c a t e R e s o u r c e L i m i t e d B l o b % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickMapDeallocateResourceLimitedBlob() deallocates a BLOB allocated +% using the resource-limited memory allocator. It is intended for +% use as the deallocate function for BLOBs so that BLOBs may easily +% be stored in a map. +% +% The format of the MagickMapDeallocateResourceLimitedBlob method is: +% +% void MagickMapDeallocateResourceLimitedBlob(void *blob) +% +% A description of each parameter follows: +% +% o blob: pointer to BLOB data to deallocate +% +*/ +MagickExport void +MagickMapDeallocateResourceLimitedBlob(void *blob) +{ + MagickFreeResourceLimitedMemory(blob); +} diff --git a/magick/map.h b/magick/map.h index 6beb7f4..77fc8d8 100644 --- a/magick/map.h +++ b/magick/map.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 GraphicsMagick Group + Copyright (C) 2003-2021 GraphicsMagick Group This program is covered by multiple licenses, which are described in Copyright.txt. You should have received a copy of Copyright.txt with this @@ -164,6 +164,30 @@ extern MagickExport void * extern MagickExport void MagickMapDeallocateBlob(void *blob); +/* + Function to copy a string allocated using resource-limited memory. +*/ +extern MagickExport void * +MagickMapCopyResourceLimitedString(const void *string, const size_t size); + +/* + Function to deallocate a string allocated using resource-limited memory. +*/ +extern MagickExport void +MagickMapDeallocateResourceLimitedString(void *string); + +/* + Function to copy a BLOB using resource-limited memory allocator. +*/ +extern MagickExport void * +MagickMapCopyResourceLimitedBlob(const void *blob, const size_t size); + +/* + Function to deallocate a BLOB allocated using resource-limited memory. +*/ +extern MagickExport void +MagickMapDeallocateResourceLimitedBlob(void *blob); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/magick/memory-private.h b/magick/memory-private.h index 0be98a2..2ab6870 100644 --- a/magick/memory-private.h +++ b/magick/memory-private.h @@ -16,10 +16,10 @@ extern MagickExport size_t MagickArraySize(const size_t count,const size_t size) MAGICK_FUNC_CONST; extern MagickExport - void *_MagickReallocateResourceLimitedMemory(void *p,const size_t count,const size_t size,const MagickBool clear); + void *_MagickReallocateResourceLimitedMemory(void *p,const size_t count,const size_t size,const MagickBool clear) MAGICK_FUNC_ALLOC_SIZE_2ARG(2,3); extern MagickExport - void *_MagickAllocateResourceLimitedMemory(const size_t size); + void *_MagickAllocateResourceLimitedMemory(const size_t size) MAGICK_FUNC_MALLOC MAGICK_FUNC_ALLOC_SIZE_1ARG(1); extern MagickExport void _MagickFreeResourceLimitedMemory(void *p); @@ -54,9 +54,10 @@ extern MagickExport /* Allocate/Reallocate/Free memory (resource limited) */ + #define MagickAllocateResourceLimitedMemory(type,size) \ ((((size) != ((size_t) (size))) || (size == 0)) ? ((type) 0) : \ - ((type) _MagickReallocateResourceLimitedMemory(0,1,(size_t) (size),MagickFalse))) + ((type) _MagickAllocateResourceLimitedMemory((size_t) (size)))) #define MagickAllocateResourceLimitedClearedMemory(type,size) \ ((((size) != ((size_t) (size))) || (size == 0)) ? ((type) 0) : \ @@ -119,6 +120,38 @@ extern MagickExport memory=0; \ } + +/* + Enumeration used with _MagickResourceLimitedMemoryGetSizeAttribute to avoid + explosion of private accessor functions. +*/ +typedef enum _MagickAllocateResourceLimitedMemoryAttribute + { + ResourceLimitedMemoryAttributeAllocSize, /* Currently requested allocation size */ + ResourceLimitedMemoryAttributeAllocSizeReal, /* Actual underlying requested allocation size */ + ResourceLimitedMemoryAttributeAllocNumReallocs, /* Number of reallocations performed */ + ResourceLimitedMemoryAttributeAllocNumReallocsMoved, /* Number of reallocations which moved memory (pointer change) */ + ResourceLimitedMemoryAttributeAllocReallocOctetsMoved /* Total octets moved due to reallocations (may overflow!) */ + } MagickAllocateResourceLimitedMemoryAttribute; + +/* + Get requested allocation size +*/ +#define MagickResourceLimitedMemoryGetAllocSize(p) \ + _MagickResourceLimitedMemoryGetSizeAttribute(p, ResourceLimitedMemoryAttributeAllocSize); + +/* + Get actual underlying allocation size +*/ +#define MagickResourceLimitedMemoryGetAllocSizeReal(p) \ + _MagickResourceLimitedMemoryGetSizeAttribute(p, ResourceLimitedMemoryAttributeAllocSizeReal); + +/* + Given an exisisting allocation, request certain attributes/metrics from it. +*/ +MagickExport size_t _MagickResourceLimitedMemoryGetSizeAttribute(const void *p, + const MagickAllocateResourceLimitedMemoryAttribute attr); + /* * Local Variables: * mode: c diff --git a/magick/memory.c b/magick/memory.c index 0dfe45d..cdf76d6 100644 --- a/magick/memory.c +++ b/magick/memory.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2020 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -587,6 +587,9 @@ typedef struct _MagickMemoryResource_T void *memory; /* Pointer to memory allocation */ size_t alloc_size; /* Requested allocation size */ size_t alloc_size_real; /* Real/underlying allocation size */ + size_t num_realloc; /* Number of actual reallocations performed */ + size_t num_realloc_moves; /* Number of reallocations which moved memory */ + size_t realloc_octets_moved; /* Number of octets moved by reallocations */ size_t signature; /* Initialized to MagickSignature */ } MagickMemoryResource_T; @@ -598,21 +601,52 @@ typedef struct _MagickMemoryResource_T /* Return MemoryResource_T pointer given user-land pointer */ #define MagickAccessMemoryResource_T_From_Pub(p) \ ((MagickMemoryResource_T *) ((char *) p-sizeof(MagickMemoryResource_T))) + /* Return user-land pointer given private base allocation pointer */ #define UserLandPointerGivenBaseAlloc(p) \ ((char *)p+sizeof(MagickMemoryResource_T)) + +/* Copy (or init) MagickMemoryResource_T based on provided user-land pointer */ +#define MagickCopyMemoryResource_T_From_Pub(memory_resource, p) \ + do { \ + if (p != 0) \ + { \ + assert(((ptrdiff_t) p - sizeof(MagickMemoryResource_T)) > 0); \ + (void) memcpy(memory_resource, \ + (void *) MagickAccessMemoryResource_T_From_Pub(p), \ + sizeof(MagickMemoryResource_T)); \ + assert((memory_resource)->signature == MagickSignature); \ + } \ + else \ + { \ + (memory_resource)->memory = 0; \ + (memory_resource)->alloc_size = 0; \ + (memory_resource)->alloc_size_real = 0; \ + (memory_resource)->num_realloc = 0; \ + (memory_resource)->num_realloc_moves = 0; \ + (memory_resource)->realloc_octets_moved = 0; \ + (memory_resource)->signature = MagickSignature; \ + } \ + } while(0) + /* Trace MemoryResource_T content given a pointer to it */ #if defined(MAGICK_DEBUG_RL_MEMORY) && MAGICK_DEBUG_RL_MEMORY #define TraceMagickAccessMemoryResource_T(operation,memory_resource) \ fprintf(stderr,__FILE__ ":%d - %s memory_resource: memory=%p (user %p)," \ " alloc_size=%zu," \ - " alloc_size_real=%zu\n", \ + " alloc_size_real=%zu," \ + " num_realloc=%zu," \ + " num_realloc_moves=%zu," \ + " realloc_octets_moved=%zu\n", \ __LINE__, \ operation, \ (memory_resource)->memory, \ (memory_resource)->memory ? UserLandPointerGivenBaseAlloc((memory_resource)->memory) : 0, \ (memory_resource)->alloc_size, \ - (memory_resource)->alloc_size_real); + (memory_resource)->alloc_size_real, \ + (memory_resource)->num_realloc, \ + (memory_resource)->num_realloc_moves, \ + (memory_resource)->realloc_octets_moved); #else #define TraceMagickAccessMemoryResource_T(operation,memory_resource) ; #endif @@ -625,6 +659,23 @@ typedef struct _MagickMemoryResource_T static void _MagickFreeResourceLimitedMemory_T(MagickMemoryResource_T *memory_resource) { TraceMagickAccessMemoryResource_T("FREE",memory_resource); +#if defined(MAGICK_MEMORY_LOG_REALLOC_STATS) && MAGICK_MEMORY_LOG_REALLOC_STATS + if (memory_resource->num_realloc > 0) + { + fprintf(stderr, + "FreeResourceLimitedMemory:" + " alloc_size=%zu," + " alloc_size_real=%zu," + " num_realloc=%zu," + " num_realloc_moves=%zu," + " realloc_octets_moved=%zu\n", + (memory_resource)->alloc_size, + (memory_resource)->alloc_size_real+sizeof(MagickMemoryResource_T), + (memory_resource)->num_realloc, + (memory_resource)->num_realloc_moves, + (memory_resource)->realloc_octets_moved); + } +#endif /* defined(MAGICK_MEMORY_LOG_REALLOC_STATS) && MAGICK_MEMORY_LOG_REALLOC_STATS */ if (memory_resource->memory != 0) { MagickFree(memory_resource->memory); @@ -632,8 +683,11 @@ static void _MagickFreeResourceLimitedMemory_T(MagickMemoryResource_T *memory_re } if (memory_resource->alloc_size != 0) LiberateMagickResource(MemoryResource, memory_resource->alloc_size); - memory_resource->alloc_size_real=0; - memory_resource->alloc_size=0; + memory_resource->alloc_size_real = 0; + memory_resource->alloc_size = 0; + memory_resource->num_realloc = 0; + memory_resource->num_realloc_moves = 0; + memory_resource->realloc_octets_moved = 0; } @@ -653,6 +707,7 @@ static void _MagickFreeResourceLimitedMemory_T(MagickMemoryResource_T *memory_re Linux malloc produces allocations aligned to 16-bytes. */ + MagickExport void *_MagickReallocateResourceLimitedMemory(void *p, const size_t count, const size_t size, @@ -666,24 +721,11 @@ MagickExport void *_MagickReallocateResourceLimitedMemory(void *p, status = MagickPass; #if defined(MAGICK_DEBUG_RL_MEMORY) && MAGICK_DEBUG_RL_MEMORY - fprintf(stderr,"%d: p = %p, count = %zu, size =%zu\n", __LINE__, p, count, size); + fprintf(stderr,"%d: p = %p, count = %zu, size = %zu\n", __LINE__, p, count, size); #endif - if (p != 0) - { - assert(((ptrdiff_t) p - sizeof(MagickMemoryResource_T)) > 0); - (void) memcpy(&memory_resource, - (void *) MagickAccessMemoryResource_T_From_Pub(p), - sizeof(MagickMemoryResource_T)); - assert(memory_resource.signature == MagickSignature); - } - else - { - memory_resource.memory = 0; - memory_resource.alloc_size = 0; - memory_resource.alloc_size_real = 0; - memory_resource.signature = MagickSignature; - } + /* Copy (or init) 'memory_resource' based on provided user-land pointer */ + MagickCopyMemoryResource_T_From_Pub(&memory_resource, p); TraceMagickAccessMemoryResource_T("BEFORE", &memory_resource); do @@ -713,18 +755,41 @@ MagickExport void *_MagickReallocateResourceLimitedMemory(void *p, if (new_size > memory_resource.alloc_size_real) { void *realloc_memory; - /* FIXME: Maybe over-allocate here if re-alloc? */ + size_t realloc_size = new_size+sizeof(MagickMemoryResource_T); + /* + If this is a realloc, then round up underlying + allocation sizes in order to lessen realloc calls + and lessen memory moves. + */ + if ((memory_resource.alloc_size_real != 0) /*&& (realloc_size < 131072)*/) + { + /* realloc_size <<= 1; */ + MagickRoundUpStringLength(realloc_size); + } realloc_memory = (ReallocFunc)(memory_resource.memory, - new_size+sizeof(MagickMemoryResource_T)); + realloc_size); if (realloc_memory != 0) { if (clear) (void) memset(UserLandPointerGivenBaseAlloc(realloc_memory)+ memory_resource.alloc_size,0,size_diff); + /* A realloc has pre-existing memory */ + if (memory_resource.alloc_size_real != 0) /* FIXME: memory_resource.alloc_size_real ? */ + { + /* Tally actual reallocations */ + memory_resource.num_realloc++; + /* Tally reallocations which resulted in a memory move */ + if (realloc_memory != memory_resource.memory) + { + memory_resource.num_realloc_moves++; + memory_resource.realloc_octets_moved += + memory_resource.alloc_size_real+sizeof(MagickMemoryResource_T); + } + } memory_resource.memory = realloc_memory; memory_resource.alloc_size = new_size; - memory_resource.alloc_size_real = new_size; + memory_resource.alloc_size_real = realloc_size-sizeof(MagickMemoryResource_T); } else { @@ -747,7 +812,13 @@ MagickExport void *_MagickReallocateResourceLimitedMemory(void *p, } else { - /* Acquire memory resource FAILED */ + /* + Acquire memory resource FAILED. If this was a + realloc, it is expected that the original pointer is + valid and retained by the user, who will responsibly + free it so its resource allocation will be released + later. + */ #if defined(ENOMEM) errno = ENOMEM; #endif /* if defined(ENOMEM) */ @@ -799,3 +870,42 @@ MagickExport void _MagickFreeResourceLimitedMemory(void *p) { _MagickReallocateResourceLimitedMemory(p,0,0,MagickFalse); } + +/* + Get current resource-limited memory size attribute (or defaulted value if NULL) +*/ +MagickExport size_t _MagickResourceLimitedMemoryGetSizeAttribute(const void *p, + const MagickAllocateResourceLimitedMemoryAttribute attr) +{ + MagickMemoryResource_T memory_resource; + size_t result = 0; + + /* Copy (or init) 'memory_resource' based on provided user-land pointer */ + MagickCopyMemoryResource_T_From_Pub(&memory_resource, p); + + switch (attr) + { + case ResourceLimitedMemoryAttributeAllocSize: + /* Currently requested allocation size */ + result = memory_resource.alloc_size; + break; + case ResourceLimitedMemoryAttributeAllocSizeReal: + /* Actual underlying requested allocation size */ + result = memory_resource.alloc_size_real; + break; + case ResourceLimitedMemoryAttributeAllocNumReallocs: + /* Number of reallocations performed */ + result = memory_resource.num_realloc; + break; + case ResourceLimitedMemoryAttributeAllocNumReallocsMoved: + /* Number of reallocations which moved memory (pointer change) */ + result = memory_resource.num_realloc_moves; + break; + case ResourceLimitedMemoryAttributeAllocReallocOctetsMoved: + /* Total number of octets moved due to reallocations (may overflow!) */ + result = memory_resource.realloc_octets_moved; + break; + } + + return result; +} diff --git a/magick/module.c b/magick/module.c index 0c5d666..e8c6eca 100644 --- a/magick/module.c +++ b/magick/module.c @@ -403,12 +403,26 @@ ExecuteModuleProcess(const char *tag,Image **image, method=(unsigned int (*)(Image **,const int,char **)) lt_dlsym(handle,method_name); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Invoking \"%.1024s\" filter module",tag); /* Execute module method */ if (method != (unsigned int (*)(Image **,const int,char **)) NULL) - status=(*method)(image,argc,argv); + { + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "Invoking \"%.1024s\" filter module",tag); + status=(*method)(image,argc,argv); + } + else + { + char + message[MaxTextExtent]; + + FormatString(message, + "Method name \"%.1024s\" was not found in module \"%.1024s\"!", + method_name, tag); + ThrowException(&(*image)->exception,ModuleError,UnableToLoadModule, + message); + status=MagickFail; + } (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Returned from \"%.1024s\" filter module",tag); diff --git a/magick/module_aliases.h b/magick/module_aliases.h index 51e43b8..39353b8 100644 --- a/magick/module_aliases.h +++ b/magick/module_aliases.h @@ -35,6 +35,7 @@ static const struct MODULEALIAS("APP1","META"), MODULEALIAS("APP1JPEG","META"), MODULEALIAS("ARW","DCRAW"), + MODULEALIAS("AVIF","HEIF"), MODULEALIAS("B","GRAY"), MODULEALIAS("BIE","JBIG"), MODULEALIAS("BIGTIFF","TIFF"), @@ -72,6 +73,7 @@ static const struct MODULEALIAS("GRAYA","GRAY"), MODULEALIAS("GROUP4RAW","TIFF"), MODULEALIAS("H","LOGO"), + MODULEALIAS("HEIC","HEIF"), MODULEALIAS("HTM","HTML"), MODULEALIAS("HTTP","URL"), MODULEALIAS("ICB","TGA"), diff --git a/magick/monitor-private.h b/magick/monitor-private.h index 03b0a0e..7dda0f7 100644 --- a/magick/monitor-private.h +++ b/magick/monitor-private.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 - 2020 GraphicsMagick Group + Copyright (C) 2003 - 2021 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio Copyright 1991-1999 E. I. du Pont de Nemours and Company @@ -16,7 +16,7 @@ DestroyMagickMonitor(void); extern MagickPassFail InitializeMagickMonitor(void); -extern MagickBool +extern MagickExport MagickBool MagickMonitorActive(void) MAGICK_FUNC_PURE; /* diff --git a/magick/monitor.c b/magick/monitor.c index be3e8d5..67b99ec 100644 --- a/magick/monitor.c +++ b/magick/monitor.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2019 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -177,7 +177,7 @@ MagickMonitor(const char *text, % MagickBool MagickMonitor(void) % */ -MagickBool +MagickExport MagickBool MagickMonitorActive(void) { return monitor_handler != (MonitorHandler) NULL ? MagickTrue : MagickFalse; diff --git a/magick/nt_base.c b/magick/nt_base.c index 8957fc5..3184b04 100644 --- a/magick/nt_base.c +++ b/magick/nt_base.c @@ -921,14 +921,13 @@ MagickExport int NTdlsetsearchpath(const char *path) */ MagickExport void *NTdlsym(void *handle,const char *name) { - LPFNDLLFUNC1 - lpfnDllFunc1; + void *func; /* FARPROC GetProcAddress(HMODULE hModule,LPCSTR lpProcName); */ - lpfnDllFunc1=(LPFNDLLFUNC1) GetProcAddress(handle,name); - if (!lpfnDllFunc1) - return((void *) NULL); - return((void *) lpfnDllFunc1); + func=(void *) GetProcAddress(handle,name); + if (!func) + return (void *) NULL; + return func; } #endif /* !defined(HasLTDL) */ @@ -1236,11 +1235,19 @@ NTGetRegistryValue(HKEY hkeyroot, const char *key, const char *name, /* Find the latest version of Ghostscript installed on the system (if any). + + Major version is one digit + Minor version is observed to two digits (zero prefixed if necessary) + Point version has one digit and 0 is used. + + Point version was added after ghostscript 9.52 + The gs_point_version value is valid if it is not -1. */ static MagickPassFail NTGhostscriptFind(const char **gs_productfamily, int *gs_major_version, - int *gs_minor_version) + int *gs_minor_version, + int *gs_point_version) { /* These are the Ghostscript product versions we will search for. @@ -1253,6 +1260,9 @@ NTGhostscriptFind(const char **gs_productfamily, "Aladdin Ghostscript" }; + char + gs_version[MaxTextExtent]; + unsigned int product_index, whence; @@ -1269,6 +1279,10 @@ NTGhostscriptFind(const char **gs_productfamily, /* Minimum version of Ghostscript is 5.50 */ *gs_major_version=5; *gs_minor_version=49; + *gs_point_version=0; + + gs_version[0]='\0'; + for(whence=0; whence<=1; whence++) { const HKEY hkeyroot = hkeys[whence].hkey; @@ -1325,31 +1339,52 @@ NTGhostscriptFind(const char **gs_productfamily, */ while ((winstatus=RegEnumKeyA(hkey, n, key, cbData)) == ERROR_SUCCESS) { + char + gs_found_version[MaxTextExtent]; + int + count, major_version, - minor_version; + minor_version, + point_version; (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), " RegEnumKeyA enumerated \"%s\"",key); n++; major_version=0; minor_version=0; - if (sscanf(key,"%d.%d",&major_version,&minor_version) != 2) + point_version=-1; + + /* Version string may be like 9.27, or 9.53.0, or 9.53.3 */ + count=sscanf(key,"%d.%d.%d",&major_version,&minor_version,&point_version); + if ((count != 2) && (count != 3)) continue; + if (count == 3) + FormatString(gs_found_version,"%d.%02d.%d",major_version, minor_version, point_version); + else + FormatString(gs_found_version,"%d.%02d",major_version, minor_version); + (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), - " Found Ghostscript (%s) version %d.%02d", + " Found Ghostscript (%s) version %s", products[product_index], - major_version, - minor_version); + gs_found_version); - if ((major_version > *gs_major_version) || + if ((major_version > *gs_major_version) + || ((major_version == *gs_major_version) && - (minor_version > *gs_minor_version))) + (minor_version > *gs_minor_version)) + || + ((major_version == *gs_major_version) && + (minor_version == *gs_minor_version) && + (point_version > *gs_point_version)) + ) { *gs_productfamily=products[product_index]; *gs_major_version=major_version; *gs_minor_version=minor_version; + *gs_point_version=point_version; + (void) strlcpy(gs_version,gs_found_version,sizeof(gs_version)); status=MagickPass; } } @@ -1387,9 +1422,8 @@ NTGhostscriptFind(const char **gs_productfamily, if (status != MagickFail) { (void) LogMagickEvent(ConfigureEvent,GetMagickModule(), - "Selected Ghostscript (%s) version %d.%02d", - *gs_productfamily,*gs_major_version, - *gs_minor_version); + "Selected Ghostscript (%s) version %s", + *gs_productfamily, gs_version); } else { @@ -1397,6 +1431,7 @@ NTGhostscriptFind(const char **gs_productfamily, "Failed to find Ghostscript!"); *gs_major_version=0; *gs_minor_version=0; + *gs_point_version=-1; } return status; @@ -1414,7 +1449,8 @@ NTGhostscriptGetString(const char *name, char *ptr, const size_t len) static int gs_major_version=0, - gs_minor_version=0; + gs_minor_version=0, + gs_point_version=-1; unsigned int i; @@ -1429,13 +1465,17 @@ NTGhostscriptGetString(const char *name, char *ptr, const size_t len) if (NULL == gs_productfamily) (void) NTGhostscriptFind(&gs_productfamily,&gs_major_version, - &gs_minor_version); + &gs_minor_version,&gs_point_version); if (NULL == gs_productfamily) return MagickFail; - FormatString(key,"SOFTWARE\\%s\\%d.%02d",gs_productfamily, - gs_major_version, gs_minor_version); + if (gs_point_version >= 0) + FormatString(key,"SOFTWARE\\%s\\%d.%02d.%d",gs_productfamily, + gs_major_version, gs_minor_version, gs_point_version); + else + FormatString(key,"SOFTWARE\\%s\\%d.%02d",gs_productfamily, + gs_major_version, gs_minor_version); for (i=0; i < sizeof(hkeys)/sizeof(hkeys[0]); ++i) { diff --git a/magick/nt_base.h b/magick/nt_base.h index 85f9bc9..63840dc 100644 --- a/magick/nt_base.h +++ b/magick/nt_base.h @@ -94,6 +94,15 @@ extern "C" { /* Define to 1 if you have the <ft2build.h> header file. */ #define HAVE_FT2BUILD_H 1 +#if defined(HasJP2) && defined(_VISUALC_) +/* Define to 1 if you have the `jp2_decode' function. */ +# define HAVE_JP2_DECODE 1 +/* Define to 1 if you have the `jpc_decode' function. */ +#define HAVE_JPC_DECODE 1 +/* Define to 1 if you have the `pgx_decode' function. */ +#define HAVE_PGX_DECODE 0 +#endif /* if defined(HasJP2) */ + // Define to support memory mapping files for improved performance #define HAVE_MMAP_FILEIO 1 diff --git a/magick/nt_feature.c b/magick/nt_feature.c index 315476c..f0c712c 100644 --- a/magick/nt_feature.c +++ b/magick/nt_feature.c @@ -78,6 +78,7 @@ % % */ +#if defined(HasWINGDI32) MagickExport void *CropImageToHBITMAP(Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { @@ -217,6 +218,7 @@ MagickExport void *CropImageToHBITMAP(Image *image, return (void *)bitmapH; } +#endif /* if defined(HasWINGDI32) */ /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -612,6 +614,7 @@ MagickExport TypeInfo* NTGetTypeList( void ) % % */ +#if defined(HasWINGDI32) MagickExport void *ImageToHBITMAP(Image* image) { unsigned long @@ -696,5 +699,6 @@ MagickExport void *ImageToHBITMAP(Image* image) return (void *)bitmapH; } +#endif /* if defined(HasWINGDI32) */ #endif diff --git a/magick/nt_feature.h b/magick/nt_feature.h index 9c246da..1d9f81a 100644 --- a/magick/nt_feature.h +++ b/magick/nt_feature.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 GraphicsMagick Group + Copyright (C) 2003-2020 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio This program is covered by multiple licenses, which are described in @@ -23,9 +23,11 @@ extern "C" { extern MagickExport char *NTRegistryKeyLookup(const char *key); +#if defined(HasWINGDI32) extern MagickExport void *CropImageToHBITMAP(Image *,const RectangleInfo *,ExceptionInfo *), *ImageToHBITMAP(Image* image); +#endif /* if defined(HasWINGDI32) */ #if !defined(XS_VERSION) diff --git a/magick/pixel_cache.c b/magick/pixel_cache.c index 18e7fcd..bed4180 100644 --- a/magick/pixel_cache.c +++ b/magick/pixel_cache.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2019 GraphicsMagick Group +% Copyright (C) 2003 - 2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -2424,7 +2424,6 @@ OpenCache(Image *image,const MapMode mode,ExceptionInfo *exception) } case MemoryCache: { - LiberateMagickResource(MemoryResource,cache_info->length); break; } case DiskCache: @@ -2498,14 +2497,21 @@ OpenCache(Image *image,const MapMode mode,ExceptionInfo *exception) if ((offset/number_pixels == (sizeof(PixelPacket)+sizeof(IndexPacket))) && (offset == (magick_uint64_t) ((size_t) offset)) && ((cache_info->type == UndefinedCache) || - (cache_info->type == MemoryCache)) && - (AcquireMagickResource(MemoryResource,offset))) + (cache_info->type == MemoryCache)) + ) { - MagickReallocMemory(PixelPacket *,cache_info->pixels,(size_t) offset); - pixels=cache_info->pixels; + pixels=MagickReallocateResourceLimitedMemory(PixelPacket *, + cache_info->pixels, + (size_t) offset); if (pixels == (PixelPacket *) NULL) - LiberateMagickResource(MemoryResource,offset); + { + MagickFreeResourceLimitedMemory(cache_info->pixels); + } else + { + cache_info->pixels=pixels; + } + if (pixels != (PixelPacket *) NULL) { /* Create in-memory pixel cache. @@ -2773,7 +2779,7 @@ AccessMutableIndexes(Image *image) % SetImagePixels() or GetImagePixels(). This is useful in order to access % an already selected region without passing the geometry of the region. % -% The format of the GetPixels() method is: +% The format of the AccessMutablePixels() method is: % % PixelPacket *AccessMutablePixels(Image image) % @@ -3623,8 +3629,7 @@ DestroyCacheInfo(Cache cache_info) */ if (MemoryCache == cache_info->type) { - MagickFreeMemory(cache_info->pixels); - LiberateMagickResource(MemoryResource,cache_info->length); + MagickFreeResourceLimitedMemory(cache_info->pixels); } else if (MapCache == cache_info->type) { diff --git a/magick/profile.c b/magick/profile.c index 27596fc..5286298 100644 --- a/magick/profile.c +++ b/magick/profile.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2017 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -1248,8 +1248,8 @@ SetImageProfile(Image *image,const char *name, const unsigned char *profile, Add or replace entry. */ if (image->profiles == 0) - image->profiles=MagickMapAllocateMap(MagickMapCopyBlob, - MagickMapDeallocateBlob); + image->profiles=MagickMapAllocateMap(MagickMapCopyResourceLimitedBlob, + MagickMapDeallocateResourceLimitedBlob); if (image->profiles == 0) ThrowBinaryException3(ResourceLimitError,MemoryAllocationFailed, @@ -1258,7 +1258,7 @@ SetImageProfile(Image *image,const char *name, const unsigned char *profile, (void) LogMagickEvent(TransformEvent,GetMagickModule(), "Adding %s profile with length %ld bytes",name, (unsigned long) length); - if (profile != 0) + if ((profile != 0) && (length != 0)) { status &= MagickMapAddEntry(image->profiles,name,profile,length, &image->exception); diff --git a/magick/profile.h b/magick/profile.h index 7d62eef..7db18f9 100644 --- a/magick/profile.h +++ b/magick/profile.h @@ -46,7 +46,7 @@ extern MagickExport MagickPassFail extern MagickExport MagickPassFail AppendImageProfile(Image *image,const char *name, const unsigned char *profile_chunk, - const size_t chunk_length); + const size_t chunk_length) MAGICK_FUNC_DEPRECATED; /* Generic iterator for traversing profiles. diff --git a/magick/random.c b/magick/random.c index 2716442..5a05640 100644 --- a/magick/random.c +++ b/magick/random.c @@ -109,9 +109,6 @@ void DestroyMagickRandomGenerator() MagickExport void InitializeMagickRandomKernel(MagickRandomKernel *kernel) { - MagickBool - done = MagickFalse; - kernel->z = 0U; kernel->w = 0U; #if defined(POSIX) && HAVE_DEV_URANDOM @@ -122,6 +119,9 @@ InitializeMagickRandomKernel(MagickRandomKernel *kernel) test for it produces an invalid result. */ { + MagickBool + done = MagickFalse; + int file; @@ -142,6 +142,9 @@ InitializeMagickRandomKernel(MagickRandomKernel *kernel) Is claimed to be supported under Windows XP */ { + MagickBool + done = MagickFalse; + HCRYPTPROV hProvider = 0; diff --git a/magick/render.c b/magick/render.c index 8d74b0c..7900955 100644 --- a/magick/render.c +++ b/magick/render.c @@ -1321,27 +1321,41 @@ AffineEdge(const Image *image,const AffineMatrix *affine, return(inverse_edge); } -static AffineMatrix -InverseAffineMatrix(const AffineMatrix *affine) +static MagickPassFail +InverseAffineMatrix(const AffineMatrix *affine, AffineMatrix *inverse_affine, + ExceptionInfo *exception) { - AffineMatrix - inverse_affine; - double - determinant, divisor; + MagickPassFail + status; + divisor=affine->sx*affine->sy-affine->rx*affine->ry; - determinant=1.0/divisor; /* oss-fuzz 28293 runtime error: division by zero */ - inverse_affine.sx=determinant*affine->sy; - inverse_affine.rx=determinant*(-affine->rx); - inverse_affine.ry=determinant*(-affine->ry); - inverse_affine.sy=determinant*affine->sx; - inverse_affine.tx= - (-affine->tx)*inverse_affine.sx-affine->ty*inverse_affine.ry; - inverse_affine.ty= - (-affine->tx)*inverse_affine.rx-affine->ty*inverse_affine.sy; - return(inverse_affine); + if (AbsoluteValue(divisor) < 0.0001) + { + char message[MaxTextExtent]; + FormatString(message,"Inverse affine divisor: %g", divisor); + ThrowException(exception,DrawError,UnreasonableAffineMatrix,message); + status=MagickFail; + } + else + { + double + determinant; + + determinant=1.0/divisor; /* oss-fuzz 28293 runtime error: division by zero */ + inverse_affine->sx=determinant*affine->sy; + inverse_affine->rx=determinant*(-affine->rx); + inverse_affine->ry=determinant*(-affine->ry); + inverse_affine->sy=determinant*affine->sx; + inverse_affine->tx= + (-affine->tx)*inverse_affine->sx-affine->ty*inverse_affine->ry; + inverse_affine->ty= + (-affine->tx)*inverse_affine->rx-affine->ty*inverse_affine->sy; + status=MagickPass; + } + return status; } #define AffineDrawImageText "[%s] Affine composite..." @@ -1425,7 +1439,9 @@ DrawAffineImage(Image *image,const Image *composite, edge.y1=min.y; edge.x2=max.x; edge.y2=max.y; - inverse_affine=InverseAffineMatrix(affine); + status &= InverseAffineMatrix(affine,&inverse_affine,&image->exception); + if (status == MagickFail) + return status; if (edge.y1 < 0) edge.y1=0.0; if (edge.y2 > image->rows - 1) @@ -2257,7 +2273,7 @@ IsPoint(const char *point) return(p != point); } -// Add two size_t values and check for unsigned overflow. +/* Add two size_t values and check for unsigned overflow. */ static MagickPassFail MagickAddSizeT(const size_t b, const size_t o, size_t *r) { *r = b+o; diff --git a/magick/resource.c b/magick/resource.c index f39a090..2e4a453 100644 --- a/magick/resource.c +++ b/magick/resource.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2019 GraphicsMagick Group +% Copyright (C) 2003 - 2022 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % % This program is covered by multiple licenses, which are described in @@ -96,15 +96,16 @@ typedef struct _ResourceInfo static ResourceInfo resource_info[] = { - { "", "", "", 0, 0, ResourceInfinity, AbsoluteLimit, 0 }, - { "disk", "B", "MAGICK_LIMIT_DISK", 0, 0, ResourceInfinity, SummationLimit, 0 }, - { "files", "", "MAGICK_LIMIT_FILES", 0, 32, 256, SummationLimit, 0 }, - { "map", "B", "MAGICK_LIMIT_MAP", 0, 0, ResourceInfinity, SummationLimit, 0 }, - { "memory", "B", "MAGICK_LIMIT_MEMORY", 0, 0, ResourceInfinity, SummationLimit, 0 }, - { "pixels", "P", "MAGICK_LIMIT_PIXELS", 0, 1, ResourceInfinity, AbsoluteLimit, 0 }, - { "threads", "", "OMP_NUM_THREADS", 1, 1, ResourceInfinity, AbsoluteLimit, 0 }, - { "width", "P", "MAGICK_LIMIT_WIDTH", 0, 1, PIXEL_LIMIT, AbsoluteLimit, 0 }, - { "height", "P", "MAGICK_LIMIT_HEIGHT", 0, 1, PIXEL_LIMIT, AbsoluteLimit, 0 } + { "", "", "", 0, 0, ResourceInfinity, AbsoluteLimit, 0 }, + { "disk", "B", "MAGICK_LIMIT_DISK", 0, 0, ResourceInfinity, SummationLimit, 0 }, + { "files", "", "MAGICK_LIMIT_FILES", 0, 32, 256, SummationLimit, 0 }, + { "map", "B", "MAGICK_LIMIT_MAP", 0, 0, ResourceInfinity, SummationLimit, 0 }, + { "memory", "B", "MAGICK_LIMIT_MEMORY", 0, 0, ResourceInfinity, SummationLimit, 0 }, + { "pixels", "P", "MAGICK_LIMIT_PIXELS", 0, 1, ResourceInfinity, AbsoluteLimit, 0 }, + { "threads", "", "OMP_NUM_THREADS", 1, 1, ResourceInfinity, AbsoluteLimit, 0 }, + { "width", "P", "MAGICK_LIMIT_WIDTH", 0, 1, PIXEL_LIMIT, AbsoluteLimit, 0 }, + { "height", "P", "MAGICK_LIMIT_HEIGHT", 0, 1, PIXEL_LIMIT, AbsoluteLimit, 0 }, + { "read", "B", "MAGICK_LIMIT_READ", 0, 4096, ResourceInfinity, AbsoluteLimit, 0 } }; /* @@ -269,6 +270,26 @@ MagickExport void DestroyMagickResources(void) size_t index; +#if defined(DEBUG_MAGICK_RESOURCES) && DEBUG_MAGICK_RESOURCES + { + const ResourceInfo *info; + + for (index = 1; index < ArraySize(resource_info); index++) + { + info=&resource_info[index]; + if (info->limit_type != SummationLimit) + continue; + + if (info->value != 0) + { + fprintf(stderr,"Resource[%s] %s! %"MAGICK_INT64_F"d remaining\n", + info->name, info->value < 0 ? "underflow" : "leak", (magick_int64_t) info->value); + assert(info->value == 0); + } + } + } +#endif /* if defined(DEBUG_MAGICK_RESOURCES) && DEBUG_MAGICK_RESOURCES */ + for (index = 1; index < ArraySize(resource_info); index++) DestroySemaphoreInfo(&resource_info[index].semaphore); } @@ -391,7 +412,8 @@ MagickExport void InitializeMagickResources(void) max_pixels=-1, max_threads=1, max_width=-1, - max_height=-1; + max_height=-1, + max_read=-1; size_t index; @@ -590,6 +612,9 @@ MagickExport void InitializeMagickResources(void) if ((envp=getenv("MAGICK_LIMIT_HEIGHT"))) max_height=MagickSizeStrToInt64(envp,1024); + if ((envp=getenv("MAGICK_LIMIT_READ"))) + max_read=MagickSizeStrToInt64(envp,1024); + #if defined(HAVE_OPENMP) max_threads=omp_get_num_procs(); (void) LogMagickEvent(ResourceEvent,GetMagickModule(), @@ -693,6 +718,8 @@ MagickExport void InitializeMagickResources(void) (void) SetMagickResourceLimit(WidthResource,max_width); if (max_height >= 0) (void) SetMagickResourceLimit(HeightResource,max_height); + if (max_read >= 0) + (void) SetMagickResourceLimit(ReadResource,max_read); } /* @@ -749,6 +776,9 @@ MagickExport void LiberateMagickResource(const ResourceType type, */ LockSemaphoreInfo(info->semaphore); info->value-=size; +#if defined(DEBUG_MAGICK_RESOURCES) && DEBUG_MAGICK_RESOURCES + assert(info->value >= info->minimum); +#endif /* if defined(DEBUG_MAGICK_RESOURCES) && DEBUG_MAGICK_RESOURCES */ value=info->value; UnlockSemaphoreInfo(info->semaphore); break; diff --git a/magick/resource.h b/magick/resource.h index 8bde9d5..e170ba9 100644 --- a/magick/resource.h +++ b/magick/resource.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 - 2015 GraphicsMagick Group + Copyright (C) 2003 - 2022 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio This program is covered by multiple licenses, which are described in @@ -24,11 +24,12 @@ typedef enum DiskResource, /* Pixel cache total disk space (Gigabytes) */ FileResource, /* Pixel cache number of open files (Files) */ MapResource, /* Pixel cache total file memory-mapping (Megabytes) */ - MemoryResource, /* Maximum pixel cache heap memory allocations (Megabytes) */ + MemoryResource, /* Maximum heap memory (e.g. malloc) allocations (Megabytes) */ PixelsResource, /* Maximum number of pixels in single image (Pixels) */ ThreadsResource, /* Maximum number of worker threads */ WidthResource, /* Maximum pixel width of an image (Pixels) */ - HeightResource /* Maximum pixel height of an image (Pixels) */ + HeightResource, /* Maximum pixel height of an image (Pixels) */ + ReadResource /* Maximum amount of uncompressed file data which may be read */ } ResourceType; /* diff --git a/magick/signature.c b/magick/signature.c index 27b0cd8..fc14efd 100644 --- a/magick/signature.c +++ b/magick/signature.c @@ -37,6 +37,7 @@ */ #include "magick/studio.h" #include "magick/attribute.h" +#include "magick/memory.h" #include "magick/monitor.h" #include "magick/pixel_cache.h" #include "magick/signature.h" @@ -46,6 +47,35 @@ Define declarations. */ #define Trunc32(x) ((x) & 0xffffffffUL) + +#define SignatureSize 64 + +/* + Typedef declarations. +*/ +typedef struct _SignatureInfo +{ + unsigned long + digest[8], + low_order, + high_order; + + long + offset; + + unsigned char + message[SignatureSize]; +} SignatureInfo; + +/* + Method declarations (FIXME: should be static!). +*/ +extern MagickExport void + FinalizeSignature(SignatureInfo *), + GetSignatureInfo(SignatureInfo *), + TransformSignature(SignatureInfo *), + UpdateSignature(SignatureInfo *,const unsigned char *,const size_t); + /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -202,7 +232,7 @@ MagickExport unsigned int SignatureImage(Image *image) */ assert(image != (Image *) NULL); assert(image->signature == MagickSignature); - message=MagickAllocateArray(unsigned char *,20,image->columns); + message=MagickAllocateResourceLimitedArray(unsigned char *,20,image->columns); if (message == (unsigned char *) NULL) ThrowBinaryException3(ResourceLimitError,MemoryAllocationFailed, UnableToComputeImageSignature); @@ -275,7 +305,7 @@ MagickExport unsigned int SignatureImage(Image *image) break; } FinalizeSignature(&signature_info); - MagickFreeMemory(message); + MagickFreeResourceLimitedMemory(message); /* Convert digital signature to a 64 character hex string. */ diff --git a/magick/signature.h b/magick/signature.h index a9431be..e8de2e2 100644 --- a/magick/signature.h +++ b/magick/signature.h @@ -16,39 +16,11 @@ extern "C" { #endif /* - Define declarations. -*/ -#define SignatureSize 64 - -/* - Typedef declarations. -*/ -typedef struct _SignatureInfo -{ - unsigned long - digest[8], - low_order, - high_order; - - long - offset; - - unsigned char - message[SignatureSize]; -} SignatureInfo; - -/* Method declarations. */ extern MagickExport unsigned int SignatureImage(Image *); -extern MagickExport void - FinalizeSignature(SignatureInfo *), - GetSignatureInfo(SignatureInfo *), - TransformSignature(SignatureInfo *), - UpdateSignature(SignatureInfo *,const unsigned char *,const size_t); - #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/magick/static.c b/magick/static.c index 5ab2904..ba2da66 100644 --- a/magick/static.c +++ b/magick/static.c @@ -96,6 +96,9 @@ static const struct STATICM("HISTOGRAM",RegisterHISTOGRAMImage,UnregisterHISTOGRAMImage), STATICM("HRZ",RegisterHRZImage,UnregisterHRZImage), STATICM("HTML",RegisterHTMLImage,UnregisterHTMLImage), +#if defined(HasHEIF) + STATICM("HEIF",RegisterHEIFImage,UnregisterHEIFImage), +#endif STATICM("ICON",RegisterICONImage,UnregisterICONImage), STATICM("IDENTITY",RegisterIDENTITYImage,UnregisterIDENTITYImage), STATICM("INFO",RegisterINFOImage,UnregisterINFOImage), @@ -111,6 +114,9 @@ static const struct #if defined(HasJP2) STATICM("JP2",RegisterJP2Image,UnregisterJP2Image), #endif +#if defined(HasJXL) + STATICM("JXL",RegisterJXLImage,UnregisterJXLImage), +#endif STATICM("LABEL",RegisterLABELImage,UnregisterLABELImage), STATICM("LOCALE",RegisterLOCALEImage,UnregisterLOCALEImage), STATICM("LOGO",RegisterLOGOImage,UnregisterLOGOImage), diff --git a/magick/static.h b/magick/static.h index e62a557..b1c32d3 100644 --- a/magick/static.h +++ b/magick/static.h @@ -70,6 +70,7 @@ extern ModuleExport void RegisterJPGImage(void), RegisterJPEGImage(void), RegisterJP2Image(void), + RegisterJXLImage(void), RegisterLABELImage(void), RegisterLOCALEImage(void), RegisterLOGOImage(void), @@ -149,6 +150,7 @@ extern ModuleExport void RegisterVSTImage(void), RegisterWBMPImage(void), RegisterWEBPImage(void), + RegisterHEIFImage(void), RegisterWMFImage(void), RegisterWPGImage(void), RegisterXImage(void), @@ -215,6 +217,7 @@ extern ModuleExport void UnregisterJPGImage(void), UnregisterJPEGImage(void), UnregisterJP2Image(void), + UnregisterJXLImage(void), UnregisterLABELImage(void), UnregisterLOCALEImage(void), UnregisterLOGOImage(void), @@ -294,6 +297,7 @@ extern ModuleExport void UnregisterVSTImage(void), UnregisterWBMPImage(void), UnregisterWEBPImage(void), + UnregisterHEIFImage(void), UnregisterWMFImage(void), UnregisterWPGImage(void), UnregisterXImage(void), diff --git a/magick/symbols.h b/magick/symbols.h index a29ee03..a1e464d 100644 --- a/magick/symbols.h +++ b/magick/symbols.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2018 GraphicsMagick Group + Copyright (C) 2012-2022 GraphicsMagick Group This program is covered by multiple licenses, which are described in Copyright.txt. You should have received a copy of Copyright.txt with this @@ -19,8 +19,8 @@ #define AccessImmutableIndexes GmAccessImmutableIndexes #define AccessMutableIndexes GmAccessMutableIndexes #define AccessMutablePixels GmAccessMutablePixels -#define AccessThreadViewData GmAccessThreadViewData #define AccessThreadViewDataById GmAccessThreadViewDataById +#define AccessThreadViewData GmAccessThreadViewData #define AcquireCacheView GmAcquireCacheView #define AcquireCacheViewIndexes GmAcquireCacheViewIndexes #define AcquireCacheViewPixels GmAcquireCacheViewPixels @@ -29,8 +29,8 @@ #define AcquireMagickResource GmAcquireMagickResource #define AcquireMemory GmAcquireMemory #define AcquireOneCacheViewPixel GmAcquireOneCacheViewPixel -#define AcquireOnePixel GmAcquireOnePixel #define AcquireOnePixelByReference GmAcquireOnePixelByReference +#define AcquireOnePixel GmAcquireOnePixel #define AcquireSemaphoreInfo GmAcquireSemaphoreInfo #define AcquireString GmAcquireString #define AcquireTemporaryFileDescriptor GmAcquireTemporaryFileDescriptor @@ -39,11 +39,11 @@ #define AdaptiveThresholdImage GmAdaptiveThresholdImage #define AddDefinition GmAddDefinition #define AddDefinitions GmAddDefinitions -#define AddNoiseImage GmAddNoiseImage #define AddNoiseImageChannel GmAddNoiseImageChannel +#define AddNoiseImage GmAddNoiseImage #define AffineTransformImage GmAffineTransformImage -#define AllocateImage GmAllocateImage #define AllocateImageColormap GmAllocateImageColormap +#define AllocateImage GmAllocateImage #define AllocateImageProfileIterator GmAllocateImageProfileIterator #define AllocateNextImage GmAllocateNextImage #define AllocateSemaphoreInfo GmAllocateSemaphoreInfo @@ -57,8 +57,8 @@ #define AnnotateImage GmAnnotateImage #define AppendImageFormat GmAppendImageFormat #define AppendImageProfile GmAppendImageProfile -#define AppendImageToList GmAppendImageToList #define AppendImages GmAppendImages +#define AppendImageToList GmAppendImageToList #define Ascii85Encode GmAscii85Encode #define Ascii85Flush GmAscii85Flush #define Ascii85Initialize GmAscii85Initialize @@ -77,8 +77,8 @@ #define BlobToFile GmBlobToFile #define BlobToImage GmBlobToImage #define BlobWriteByteHook GmBlobWriteByteHook -#define BlurImage GmBlurImage #define BlurImageChannel GmBlurImageChannel +#define BlurImage GmBlurImage #define BorderImage GmBorderImage #define CatchException GmCatchException #define CatchImageException GmCatchImageException @@ -94,8 +94,8 @@ #define ClipPathImage GmClipPathImage #define CloneBlobInfo GmCloneBlobInfo #define CloneDrawInfo GmCloneDrawInfo -#define CloneImage GmCloneImage #define CloneImageAttributes GmCloneImageAttributes +#define CloneImage GmCloneImage #define CloneImageInfo GmCloneImageInfo #define CloneImageList GmCloneImageList #define CloneMemory GmCloneMemory @@ -106,12 +106,12 @@ #define CloseCacheView GmCloseCacheView #define CoalesceImages GmCoalesceImages #define ColorFloodfillImage GmColorFloodfillImage -#define ColorMatrixImage GmColorMatrixImage #define ColorizeImage GmColorizeImage +#define ColorMatrixImage GmColorMatrixImage #define ColorspaceTypeToString GmColorspaceTypeToString #define CompareImageCommand GmCompareImageCommand -#define CompositeImage GmCompositeImage #define CompositeImageCommand GmCompositeImageCommand +#define CompositeImage GmCompositeImage #define CompositeImageRegion GmCompositeImageRegion #define CompositeMaskImage GmCompositeMaskImage #define CompositeOperatorToString GmCompositeOperatorToString @@ -148,15 +148,15 @@ #define DestroyDelegateInfo GmDestroyDelegateInfo #define DestroyDrawInfo GmDestroyDrawInfo #define DestroyExceptionInfo GmDestroyExceptionInfo -#define DestroyImage GmDestroyImage #define DestroyImageAttributes GmDestroyImageAttributes +#define DestroyImage GmDestroyImage #define DestroyImageInfo GmDestroyImageInfo #define DestroyImageList GmDestroyImageList #define DestroyImagePixels GmDestroyImagePixels #define DestroyLogInfo GmDestroyLogInfo #define DestroyMagicInfo GmDestroyMagicInfo -#define DestroyMagick GmDestroyMagick #define DestroyMagickExceptionHandling GmDestroyMagickExceptionHandling +#define DestroyMagick GmDestroyMagick #define DestroyMagickModules GmDestroyMagickModules #define DestroyMagickMonitor GmDestroyMagickMonitor #define DestroyMagickRandomGenerator GmDestroyMagickRandomGenerator @@ -176,6 +176,7 @@ #define DispatchImage GmDispatchImage #define DisplayImageCommand GmDisplayImageCommand #define DisplayImages GmDisplayImages +#define DisposeTypeToString GmDisposeTypeToString #define DrawAffine GmDrawAffine #define DrawAffineImage GmDrawAffineImage #define DrawAllocateContext GmDrawAllocateContext @@ -196,8 +197,8 @@ #define DrawGetFillColor GmDrawGetFillColor #define DrawGetFillOpacity GmDrawGetFillOpacity #define DrawGetFillRule GmDrawGetFillRule -#define DrawGetFont GmDrawGetFont #define DrawGetFontFamily GmDrawGetFontFamily +#define DrawGetFont GmDrawGetFont #define DrawGetFontSize GmDrawGetFontSize #define DrawGetFontStretch GmDrawGetFontStretch #define DrawGetFontStyle GmDrawGetFontStyle @@ -268,8 +269,8 @@ #define DrawSetFillOpacity GmDrawSetFillOpacity #define DrawSetFillPatternURL GmDrawSetFillPatternURL #define DrawSetFillRule GmDrawSetFillRule -#define DrawSetFont GmDrawSetFont #define DrawSetFontFamily GmDrawSetFontFamily +#define DrawSetFont GmDrawSetFont #define DrawSetFontSize GmDrawSetFontSize #define DrawSetFontStretch GmDrawSetFontStretch #define DrawSetFontStyle GmDrawSetFontStyle @@ -295,11 +296,11 @@ #define DrawSkewX GmDrawSkewX #define DrawSkewY GmDrawSkewY #define DrawTranslate GmDrawTranslate -#define EOFBlob GmEOFBlob #define EdgeImage GmEdgeImage #define EmbossImage GmEmbossImage #define EndianTypeToString GmEndianTypeToString #define EnhanceImage GmEnhanceImage +#define EOFBlob GmEOFBlob #define EqualizeImage GmEqualizeImage #define EscapeString GmEscapeString #define ExecuteModuleProcess GmExecuteModuleProcess @@ -322,8 +323,8 @@ #define FrameImage GmFrameImage #define FuzzyColorMatch GmFuzzyColorMatch #define GammaImage GmGammaImage -#define GaussianBlurImage GmGaussianBlurImage #define GaussianBlurImageChannel GmGaussianBlurImageChannel +#define GaussianBlurImage GmGaussianBlurImage #define GenerateDifferentialNoise GmGenerateDifferentialNoise #define GenerateNoise GmGenerateNoise #define GetBlobFileHandle GmGetBlobFileHandle @@ -335,8 +336,8 @@ #define GetBlobStreamData GmGetBlobStreamData #define GetBlobTemporary GmGetBlobTemporary #define GetCacheInfo GmGetCacheInfo -#define GetCacheView GmGetCacheView #define GetCacheViewArea GmGetCacheViewArea +#define GetCacheView GmGetCacheView #define GetCacheViewImage GmGetCacheViewImage #define GetCacheViewIndexes GmGetCacheViewIndexes #define GetCacheViewPixels GmGetCacheViewPixels @@ -345,8 +346,8 @@ #define GetClientName GmGetClientName #define GetClientPath GmGetClientPath #define GetColorHistogram GmGetColorHistogram -#define GetColorInfo GmGetColorInfo #define GetColorInfoArray GmGetColorInfoArray +#define GetColorInfo GmGetColorInfo #define GetColorList GmGetColorList #define GetColorTuple GmGetColorTuple #define GetConfigureBlob GmGetConfigureBlob @@ -375,12 +376,12 @@ #define GetImageFromMagickRegistry GmGetImageFromMagickRegistry #define GetImageGeometry GmGetImageGeometry #define GetImageIndexInList GmGetImageIndexInList -#define GetImageInfo GmGetImageInfo #define GetImageInfoAttribute GmGetImageInfoAttribute +#define GetImageInfo GmGetImageInfo #define GetImageListLength GmGetImageListLength #define GetImageMagick GmGetImageMagick -#define GetImagePixels GmGetImagePixels #define GetImagePixelsEx GmGetImagePixelsEx +#define GetImagePixels GmGetImagePixels #define GetImageProfile GmGetImageProfile #define GetImageQuantizeError GmGetImageQuantizeError #define GetImageStatistics GmGetImageStatistics @@ -389,14 +390,14 @@ #define GetIndexes GmGetIndexes #define GetLastImageInList GmGetLastImageInList #define GetLocaleExceptionMessage GmGetLocaleExceptionMessage -#define GetLocaleMessage GmGetLocaleMessage #define GetLocaleMessageFromID GmGetLocaleMessageFromID +#define GetLocaleMessage GmGetLocaleMessage #define GetMagickCopyright GmGetMagickCopyright #define GetMagickDimension GmGetMagickDimension #define GetMagickFileFormat GmGetMagickFileFormat #define GetMagickGeometry GmGetMagickGeometry -#define GetMagickInfo GmGetMagickInfo #define GetMagickInfoArray GmGetMagickInfoArray +#define GetMagickInfo GmGetMagickInfo #define GetMagickRegistry GmGetMagickRegistry #define GetMagickResource GmGetMagickResource #define GetMagickResourceLimit GmGetMagickResourceLimit @@ -406,9 +407,9 @@ #define GetNextImageInList GmGetNextImageInList #define GetNumberColors GmGetNumberColors #define GetOnePixel GmGetOnePixel -#define GetOptimalKernelWidth GmGetOptimalKernelWidth #define GetOptimalKernelWidth1D GmGetOptimalKernelWidth1D #define GetOptimalKernelWidth2D GmGetOptimalKernelWidth2D +#define GetOptimalKernelWidth GmGetOptimalKernelWidth #define GetPageGeometry GmGetPageGeometry #define GetPathComponent GmGetPathComponent #define GetPixelCacheArea GmGetPixelCacheArea @@ -423,8 +424,8 @@ #define GetTimerInfo GmGetTimerInfo #define GetTimerResolution GmGetTimerResolution #define GetToken GmGetToken -#define GetTypeInfo GmGetTypeInfo #define GetTypeInfoByFamily GmGetTypeInfoByFamily +#define GetTypeInfo GmGetTypeInfo #define GetTypeList GmGetTypeList #define GetTypeMetrics GmGetTypeMetrics #define GetUserTime GmGetUserTime @@ -432,14 +433,14 @@ #define GradientImage GmGradientImage #define GravityTypeToString GmGravityTypeToString #define GrayscalePseudoClassImage GmGrayscalePseudoClassImage -#define HSLTransform GmHSLTransform -#define HWBTransform GmHWBTransform #define HaldClutImage GmHaldClutImage #define HighlightStyleToString GmHighlightStyleToString +#define HSLTransform GmHSLTransform #define HuffmanDecodeImage GmHuffmanDecodeImage #define HuffmanEncode2Image GmHuffmanEncode2Image #define HuffmanEncodeImage GmHuffmanEncodeImage #define Hull GmHull +#define HWBTransform GmHWBTransform #define IdentifyImageCommand GmIdentifyImageCommand #define IdentityAffine GmIdentityAffine #define ImageGetClipMask GmImageGetClipMask @@ -465,9 +466,9 @@ #define InitializeLogInfo GmInitializeLogInfo #define InitializeLogInfoPost GmInitializeLogInfoPost #define InitializeMagicInfo GmInitializeMagicInfo -#define InitializeMagick GmInitializeMagick -#define InitializeMagickEx GmInitializeMagickEx #define InitializeMagickExceptionHandling GmInitializeMagickExceptionHandling +#define InitializeMagickEx GmInitializeMagickEx +#define InitializeMagick GmInitializeMagick #define InitializeMagickModules GmInitializeMagickModules #define InitializeMagickMonitor GmInitializeMagickMonitor #define InitializeMagickRandomGenerator GmInitializeMagickRandomGenerator @@ -485,8 +486,8 @@ #define InterpolateViewColor GmInterpolateViewColor #define InvokeDelegate GmInvokeDelegate #define InvokePostscriptDelegate GmInvokePostscriptDelegate -#define IsAccessible GmIsAccessible #define IsAccessibleAndNotEmpty GmIsAccessibleAndNotEmpty +#define IsAccessible GmIsAccessible #define IsAccessibleNoLogging GmIsAccessibleNoLogging #define IsEventLogging GmIsEventLogging #define IsGeometry GmIsGeometry @@ -500,10 +501,8 @@ #define IsSubimage GmIsSubimage #define IsTaintImage GmIsTaintImage #define IsWriteable GmIsWriteable -#define LZWEncode2Image GmLZWEncode2Image -#define LZWEncodeImage GmLZWEncodeImage -#define LevelImage GmLevelImage #define LevelImageChannel GmLevelImageChannel +#define LevelImage GmLevelImage #define LiberateMagickResource GmLiberateMagickResource #define LiberateMemory GmLiberateMemory #define LiberateSemaphoreInfo GmLiberateSemaphoreInfo @@ -521,8 +520,8 @@ #define LocaleNCompare GmLocaleNCompare #define LocaleUpper GmLocaleUpper #define LockSemaphoreInfo GmLockSemaphoreInfo -#define MSBOrderLong GmMSBOrderLong -#define MSBOrderShort GmMSBOrderShort +#define LZWEncode2Image GmLZWEncode2Image +#define LZWEncodeImage GmLZWEncodeImage #define MagickAllocFunctions GmMagickAllocFunctions #define MagickArraySize GmMagickArraySize #define MagickAtoFChk GmMagickAtoFChk @@ -547,8 +546,8 @@ #define MagickFmin GmMagickFmin #define MagickFormatString GmMagickFormatString #define MagickFormatStringList GmMagickFormatStringList -#define MagickFree GmMagickFree #define MagickFreeAligned GmMagickFreeAligned +#define MagickFree GmMagickFree #define MagickGetBitRevTable GmMagickGetBitRevTable #define MagickGetFileAttributes GmMagickGetFileAttributes #define MagickGetFileSystemBlockSize GmMagickGetFileSystemBlockSize @@ -557,11 +556,11 @@ #define MagickGetToken GmMagickGetToken #define MagickInitializeCommandInfo GmMagickInitializeCommandInfo #define MagickIsTrue GmMagickIsTrue -#define MagickMalloc GmMagickMalloc -#define MagickMallocAligned GmMagickMallocAligned #define MagickMallocAlignedArray GmMagickMallocAlignedArray +#define MagickMallocAligned GmMagickMallocAligned #define MagickMallocArray GmMagickMallocArray #define MagickMallocCleared GmMagickMallocCleared +#define MagickMalloc GmMagickMalloc #define MagickMapAccessEntry GmMagickMapAccessEntry #define MagickMapAddEntry GmMagickMapAddEntry #define MagickMapAllocateIterator GmMagickMapAllocateIterator @@ -569,10 +568,14 @@ #define MagickMapClearMap GmMagickMapClearMap #define MagickMapCloneMap GmMagickMapCloneMap #define MagickMapCopyBlob GmMagickMapCopyBlob +#define MagickMapCopyResourceLimitedBlob GmMagickMapCopyResourceLimitedBlob +#define MagickMapCopyResourceLimitedString GmMagickMapCopyResourceLimitedString #define MagickMapCopyString GmMagickMapCopyString #define MagickMapDeallocateBlob GmMagickMapDeallocateBlob #define MagickMapDeallocateIterator GmMagickMapDeallocateIterator #define MagickMapDeallocateMap GmMagickMapDeallocateMap +#define MagickMapDeallocateResourceLimitedBlob GmMagickMapDeallocateResourceLimitedBlob +#define MagickMapDeallocateResourceLimitedString GmMagickMapDeallocateResourceLimitedString #define MagickMapDeallocateString GmMagickMapDeallocateString #define MagickMapDereferenceIterator GmMagickMapDereferenceIterator #define MagickMapIterateNext GmMagickMapIterateNext @@ -580,13 +583,13 @@ #define MagickMapIterateToBack GmMagickMapIterateToBack #define MagickMapIterateToFront GmMagickMapIterateToFront #define MagickMapRemoveEntry GmMagickMapRemoveEntry -#define MagickMonitor GmMagickMonitor #define MagickMonitorActive GmMagickMonitorActive #define MagickMonitorFormatted GmMagickMonitorFormatted +#define MagickMonitor GmMagickMonitor #define MagickRandNewSeed GmMagickRandNewSeed -#define MagickRandReentrant GmMagickRandReentrant #define MagickRandomInteger GmMagickRandomInteger #define MagickRandomReal GmMagickRandomReal +#define MagickRandReentrant GmMagickRandReentrant #define MagickRealloc GmMagickRealloc #define MagickReverseBits GmMagickReverseBits #define MagickSceneFileName GmMagickSceneFileName @@ -596,6 +599,7 @@ #define MagickSizeStrToInt64 GmMagickSizeStrToInt64 #define MagickSpawnVP GmMagickSpawnVP #define MagickStripSpacesFromString GmMagickStripSpacesFromString +#define MagickStripString GmMagickStripString #define MagickStrlCat GmMagickStrlCat #define MagickStrlCpy GmMagickStrlCpy #define MagickStrlCpyTrunc GmMagickStrlCpyTrunc @@ -609,15 +613,15 @@ #define MagickSwabUInt32 GmMagickSwabUInt32 #define MagickToMime GmMagickToMime #define MagickTsdGetSpecific GmMagickTsdGetSpecific -#define MagickTsdKeyCreate GmMagickTsdKeyCreate #define MagickTsdKeyCreate2 GmMagickTsdKeyCreate2 +#define MagickTsdKeyCreate GmMagickTsdKeyCreate #define MagickTsdKeyDelete GmMagickTsdKeyDelete #define MagickTsdSetSpecific GmMagickTsdSetSpecific #define MagickWordStreamInitializeRead GmMagickWordStreamInitializeRead #define MagickWordStreamInitializeWrite GmMagickWordStreamInitializeWrite #define MagickWordStreamLSBRead GmMagickWordStreamLSBRead -#define MagickWordStreamLSBWrite GmMagickWordStreamLSBWrite #define MagickWordStreamLSBWriteFlush GmMagickWordStreamLSBWriteFlush +#define MagickWordStreamLSBWrite GmMagickWordStreamLSBWrite #define MagickXAnimateBackgroundImage GmMagickXAnimateBackgroundImage #define MagickXAnimateImages GmMagickXAnimateImages #define MagickXAnnotateImage GmMagickXAnnotateImage @@ -704,14 +708,16 @@ #define ModifyImage GmModifyImage #define Modulate GmModulate #define ModulateImage GmModulateImage -#define MogrifyImage GmMogrifyImage #define MogrifyImageCommand GmMogrifyImageCommand +#define MogrifyImage GmMogrifyImage #define MogrifyImages GmMogrifyImages #define MontageImageCommand GmMontageImageCommand #define MontageImages GmMontageImages #define MorphImages GmMorphImages #define MosaicImages GmMosaicImages #define MotionBlurImage GmMotionBlurImage +#define MSBOrderLong GmMSBOrderLong +#define MSBOrderShort GmMSBOrderShort #define MultilineCensus GmMultilineCensus #define NegateImage GmNegateImage #define NewImageList GmNewImageList @@ -744,8 +750,8 @@ #define PopImagePixels GmPopImagePixels #define PrependImageToList GmPrependImageToList #define ProfileImage GmProfileImage -#define PurgeTemporaryFiles GmPurgeTemporaryFiles #define PurgeTemporaryFilesAsyncSafe GmPurgeTemporaryFilesAsyncSafe +#define PurgeTemporaryFiles GmPurgeTemporaryFiles #define PushImagePixels GmPushImagePixels #define QuantizeImage GmQuantizeImage #define QuantizeImages GmQuantizeImages @@ -757,12 +763,11 @@ #define QuantumTypeToString GmQuantumTypeToString #define QueryColorDatabase GmQueryColorDatabase #define QueryColorname GmQueryColorname -#define RGBTransformImage GmRGBTransformImage #define RaiseImage GmRaiseImage #define RandomChannelThresholdImage GmRandomChannelThresholdImage #define ReacquireMemory GmReacquireMemory -#define ReadBlob GmReadBlob #define ReadBlobByte GmReadBlobByte +#define ReadBlob GmReadBlob #define ReadBlobLSBDouble GmReadBlobLSBDouble #define ReadBlobLSBDoubles GmReadBlobLSBDoubles #define ReadBlobLSBFloat GmReadBlobLSBFloat @@ -811,6 +816,7 @@ #define RegisterGIFImage GmRegisterGIFImage #define RegisterGRADIENTImage GmRegisterGRADIENTImage #define RegisterGRAYImage GmRegisterGRAYImage +#define RegisterHEIFImage GmRegisterHEIFImage #define RegisterHISTOGRAMImage GmRegisterHISTOGRAMImage #define RegisterHRZImage GmRegisterHRZImage #define RegisterHTMLImage GmRegisterHTMLImage @@ -821,10 +827,12 @@ #define RegisterJNXImage GmRegisterJNXImage #define RegisterJP2Image GmRegisterJP2Image #define RegisterJPEGImage GmRegisterJPEGImage +#define RegisterJXLImage GmRegisterJXLImage #define RegisterLABELImage GmRegisterLABELImage #define RegisterLOCALEImage GmRegisterLOCALEImage #define RegisterLOGOImage GmRegisterLOGOImage #define RegisterMACImage GmRegisterMACImage +#define RegisterMagickInfo GmRegisterMagickInfo #define RegisterMAPImage GmRegisterMAPImage #define RegisterMATImage GmRegisterMATImage #define RegisterMATTEImage GmRegisterMATTEImage @@ -837,7 +845,6 @@ #define RegisterMSLImage GmRegisterMSLImage #define RegisterMTVImage GmRegisterMTVImage #define RegisterMVGImage GmRegisterMVGImage -#define RegisterMagickInfo GmRegisterMagickInfo #define RegisterNULLImage GmRegisterNULLImage #define RegisterOTBImage GmRegisterOTBImage #define RegisterPALMImage GmRegisterPALMImage @@ -862,10 +869,10 @@ #define RegisterSCTImage GmRegisterSCTImage #define RegisterSFWImage GmRegisterSFWImage #define RegisterSGIImage GmRegisterSGIImage +#define RegisterStaticModules GmRegisterStaticModules #define RegisterSTEGANOImage GmRegisterSTEGANOImage #define RegisterSUNImage GmRegisterSUNImage #define RegisterSVGImage GmRegisterSVGImage -#define RegisterStaticModules GmRegisterStaticModules #define RegisterTGAImage GmRegisterTGAImage #define RegisterTIFFImage GmRegisterTIFFImage #define RegisterTILEImage GmRegisterTILEImage @@ -901,6 +908,7 @@ #define ResizeImage GmResizeImage #define ResolutionTypeToString GmResolutionTypeToString #define ReverseImageList GmReverseImageList +#define RGBTransformImage GmRGBTransformImage #define RollImage GmRollImage #define RotateImage GmRotateImage #define SampleImage GmSampleImage @@ -918,7 +926,6 @@ #define SetExceptionInfo GmSetExceptionInfo #define SetFatalErrorHandler GmSetFatalErrorHandler #define SetGeometry GmSetGeometry -#define SetImage GmSetImage #define SetImageAttribute GmSetImageAttribute #define SetImageChannelDepth GmSetImageChannelDepth #define SetImageClipMask GmSetImageClipMask @@ -927,10 +934,11 @@ #define SetImageCompositeMask GmSetImageCompositeMask #define SetImageDepth GmSetImageDepth #define SetImageEx GmSetImageEx +#define SetImage GmSetImage #define SetImageInfo GmSetImageInfo #define SetImageOpacity GmSetImageOpacity -#define SetImagePixels GmSetImagePixels #define SetImagePixelsEx GmSetImagePixelsEx +#define SetImagePixels GmSetImagePixels #define SetImageProfile GmSetImageProfile #define SetImageType GmSetImageType #define SetImageVirtualPixelMethod GmSetImageVirtualPixelMethod @@ -948,8 +956,8 @@ #define SetMonitorHandler GmSetMonitorHandler #define SetWarningHandler GmSetWarningHandler #define ShadeImage GmShadeImage -#define SharpenImage GmSharpenImage #define SharpenImageChannel GmSharpenImageChannel +#define SharpenImage GmSharpenImage #define ShaveImage GmShaveImage #define ShearImage GmShearImage #define SignatureImage GmSignatureImage @@ -969,6 +977,7 @@ #define StringToColorspaceType GmStringToColorspaceType #define StringToCompositeOperator GmStringToCompositeOperator #define StringToCompressionType GmStringToCompressionType +#define StringToDisposeType GmStringToDisposeType #define StringToDouble GmStringToDouble #define StringToEndianType GmStringToEndianType #define StringToFilterTypes GmStringToFilterTypes @@ -993,8 +1002,8 @@ #define SyncCacheView GmSyncCacheView #define SyncCacheViewPixels GmSyncCacheViewPixels #define SyncImage GmSyncImage -#define SyncImagePixels GmSyncImagePixels #define SyncImagePixelsEx GmSyncImagePixelsEx +#define SyncImagePixels GmSyncImagePixels #define SyncNextImageInList GmSyncNextImageInList #define SystemCommand GmSystemCommand #define TellBlob GmTellBlob @@ -1010,8 +1019,8 @@ #define TransformImage GmTransformImage #define TransformRGBImage GmTransformRGBImage #define TransformSignature GmTransformSignature -#define TranslateText GmTranslateText #define TranslateTextEx GmTranslateTextEx +#define TranslateText GmTranslateText #define TransparentImage GmTransparentImage #define UnlockSemaphoreInfo GmUnlockSemaphoreInfo #define UnmapBlob GmUnmapBlob @@ -1034,6 +1043,7 @@ #define UnregisterGIFImage GmUnregisterGIFImage #define UnregisterGRADIENTImage GmUnregisterGRADIENTImage #define UnregisterGRAYImage GmUnregisterGRAYImage +#define UnregisterHEIFImage GmUnregisterHEIFImage #define UnregisterHISTOGRAMImage GmUnregisterHISTOGRAMImage #define UnregisterHRZImage GmUnregisterHRZImage #define UnregisterHTMLImage GmUnregisterHTMLImage @@ -1044,10 +1054,12 @@ #define UnregisterJNXImage GmUnregisterJNXImage #define UnregisterJP2Image GmUnregisterJP2Image #define UnregisterJPEGImage GmUnregisterJPEGImage +#define UnregisterJXLImage GmUnregisterJXLImage #define UnregisterLABELImage GmUnregisterLABELImage #define UnregisterLOCALEImage GmUnregisterLOCALEImage #define UnregisterLOGOImage GmUnregisterLOGOImage #define UnregisterMACImage GmUnregisterMACImage +#define UnregisterMagickInfo GmUnregisterMagickInfo #define UnregisterMAPImage GmUnregisterMAPImage #define UnregisterMATImage GmUnregisterMATImage #define UnregisterMATTEImage GmUnregisterMATTEImage @@ -1060,7 +1072,6 @@ #define UnregisterMSLImage GmUnregisterMSLImage #define UnregisterMTVImage GmUnregisterMTVImage #define UnregisterMVGImage GmUnregisterMVGImage -#define UnregisterMagickInfo GmUnregisterMagickInfo #define UnregisterNULLImage GmUnregisterNULLImage #define UnregisterOTBImage GmUnregisterOTBImage #define UnregisterPALMImage GmUnregisterPALMImage @@ -1085,10 +1096,10 @@ #define UnregisterSCTImage GmUnregisterSCTImage #define UnregisterSFWImage GmUnregisterSFWImage #define UnregisterSGIImage GmUnregisterSGIImage +#define UnregisterStaticModules GmUnregisterStaticModules #define UnregisterSTEGANOImage GmUnregisterSTEGANOImage #define UnregisterSUNImage GmUnregisterSUNImage #define UnregisterSVGImage GmUnregisterSVGImage -#define UnregisterStaticModules GmUnregisterStaticModules #define UnregisterTGAImage GmUnregisterTGAImage #define UnregisterTIFFImage GmUnregisterTIFFImage #define UnregisterTILEImage GmUnregisterTILEImage @@ -1113,14 +1124,14 @@ #define UnregisterXPMImage GmUnregisterXPMImage #define UnregisterXWDImage GmUnregisterXWDImage #define UnregisterYUVImage GmUnregisterYUVImage -#define UnsharpMaskImage GmUnsharpMaskImage #define UnsharpMaskImageChannel GmUnsharpMaskImageChannel +#define UnsharpMaskImage GmUnsharpMaskImage #define UpdateSignature GmUpdateSignature #define WaveImage GmWaveImage #define WhiteThresholdImage GmWhiteThresholdImage -#define WriteBlob GmWriteBlob #define WriteBlobByte GmWriteBlobByte #define WriteBlobFile GmWriteBlobFile +#define WriteBlob GmWriteBlob #define WriteBlobLSBLong GmWriteBlobLSBLong #define WriteBlobLSBShort GmWriteBlobLSBShort #define WriteBlobLSBSignedLong GmWriteBlobLSBSignedLong @@ -1129,12 +1140,12 @@ #define WriteBlobMSBShort GmWriteBlobMSBShort #define WriteBlobMSBSignedLong GmWriteBlobMSBSignedLong #define WriteBlobMSBSignedShort GmWriteBlobMSBSignedShort -#define WriteBlobString GmWriteBlobString #define WriteBlobStringEOL GmWriteBlobStringEOL +#define WriteBlobString GmWriteBlobString #define WriteBlobStringWithEOL GmWriteBlobStringWithEOL #define WriteImage GmWriteImage -#define WriteImages GmWriteImages #define WriteImagesFile GmWriteImagesFile +#define WriteImages GmWriteImages #define ZoomImage GmZoomImage #endif /* defined(PREFIX_MAGICK_SYMBOLS) */ diff --git a/magick/transform.c b/magick/transform.c index 6348667..26fa921 100644 --- a/magick/transform.c +++ b/magick/transform.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003 - 2020 GraphicsMagick Group +% Copyright (C) 2003 - 2021 GraphicsMagick Group % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company % @@ -40,6 +40,7 @@ #include "magick/analyze.h" #include "magick/color.h" #include "magick/composite.h" +#include "magick/log.h" #include "magick/monitor.h" #include "magick/pixel_cache.h" #include "magick/resize.h" @@ -504,6 +505,11 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, assert(geometry != (const RectangleInfo *) NULL); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); + if (image->logging) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Crop Geometry: %lux%lu%+ld%+ld", + geometry->width, geometry->height, + geometry->x, geometry->y); if ((geometry->width != 0) || (geometry->height != 0)) { if (((geometry->x+(long) geometry->width) < 0) || @@ -545,6 +551,10 @@ MagickExport Image *CropImage(const Image *image,const RectangleInfo *geometry, page.y-=geometry->y; if (page.y < 0) page.y=0; + if (image->logging) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Bounding Page: %lux%lu%+ld%+ld", + page.width, page.height, page.x, page.y); if ((((long) page.width+page.x) > (long) image->columns) || (((long) page.height+page.y) > (long) image->rows)) ThrowImageException(OptionError,GeometryDoesNotContainImage, @@ -1515,6 +1525,8 @@ MagickExport Image *RollImage(const Image *image,const long x_offset, */ assert(image != (const Image *) NULL); assert(image->signature == MagickSignature); + assert(image->columns != 0); + assert(image->rows != 0); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); roll_image=CloneImage(image,image->columns,image->rows,True,exception); @@ -1675,6 +1687,11 @@ MagickExport MagickPassFail TransformImage(Image **image,const char *crop_geomet */ crop_image=(Image *) NULL; flags=GetImageGeometry(transform_image,crop_geometry,False,&geometry); + if (transform_image->logging) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Crop Geometry: %lux%lu%+ld%+ld", + geometry.width, geometry.height, + geometry.x, geometry.y); if ((geometry.width == 0) || (geometry.height == 0) || ((flags & XValue) != 0) || ((flags & YValue) != 0) || (flags & PercentValue)) @@ -1753,6 +1770,11 @@ MagickExport MagickPassFail TransformImage(Image **image,const char *crop_geomet SetGeometry(transform_image,&geometry); flags=GetMagickGeometry(image_geometry,&geometry.x,&geometry.y, &geometry.width,&geometry.height); + if (transform_image->logging) + (void) LogMagickEvent(TransformEvent,GetMagickModule(), + "Transform Geometry: %lux%lu%+ld%+ld", + geometry.width, geometry.height, + geometry.x, geometry.y); if ((transform_image->columns == geometry.width) && (transform_image->rows == geometry.height)) return status; diff --git a/magick/tsd.c b/magick/tsd.c index 773ac89..3ccc7c6 100644 --- a/magick/tsd.c +++ b/magick/tsd.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2005,2013,2014 GraphicsMagick Group + Copyright (C) 2005-2021 GraphicsMagick Group This program is covered by multiple licenses, which are described in Copyright.txt. You should have received a copy of Copyright.txt with this @@ -113,6 +113,7 @@ MagickExport MagickPassFail MagickTsdKeyDelete(MagickTsdKey_t key) } } } + MagickFreeMemory(keyd->values); MagickFreeMemory(keyd); return MagickPass; #endif diff --git a/magick/utility-private.h b/magick/utility-private.h index 3a74dc3..66ee934 100644 --- a/magick/utility-private.h +++ b/magick/utility-private.h @@ -31,25 +31,31 @@ extern MagickExport MagickPassFail MagickAtoIChk(const char *str, int *value); extern MagickExport MagickPassFail MagickAtoUIChk(const char *str, unsigned int *value); extern MagickExport MagickPassFail MagickAtoLChk(const char *str, long *value); extern MagickExport MagickPassFail MagickAtoULChk(const char *str, unsigned long *value); -extern MagickExport long MagickDoubleToLong(const double dval/*, ExceptionInfo *exception*/); +extern MagickExport long MagickDoubleToLong(const double dval/*, ExceptionInfo *exception*/) MAGICK_FUNC_CONST; + +extern MagickExport size_t + MagickStripSpacesFromString(char *string), + MagickStripString(char *string); /* Compute a value which is the next kilobyte power of 2 larger than - the requested value or MaxTextExtent, whichever is larger. + the requested value or 256 whichever is larger. The objective is to round up the size quickly (and in repeatable steps) in order to reduce the number of memory copies due to realloc for strings which grow rapidly, while producing a reasonable size for smaller strings. */ -#define MagickRoundUpStringLength(size) \ -{ \ - size_t \ - _rounded; \ - \ - for (_rounded=256U; _rounded < (Max(size,256)); _rounded *= 2); \ - size=_rounded; \ -} +#define MagickRoundUpStringLength(size) \ + do { \ + size_t \ + _rounded, \ + _target; \ + \ + _target=(Max(size,256)); \ + for (_rounded=256U; _rounded < _target; _rounded *= 2); \ + size=_rounded; \ +} while(0) /* * Local Variables: diff --git a/magick/utility.c b/magick/utility.c index 2fd0609..3a64b4e 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -1,5 +1,5 @@ /* -% Copyright (C) 2003-2020 GraphicsMagick Group +% Copyright (C) 2003-2021 GraphicsMagick Group % Copyright (c) 2000 Markus Friedl. All rights reserved. % Copyright (C) 2002 ImageMagick Studio % Copyright 1991-1999 E. I. du Pont de Nemours and Company @@ -3654,12 +3654,12 @@ MagickExport long MagickDoubleToLong(const double dval/*, ExceptionInfo *excepti lval=0; break; } - if (dval > LONG_MAX) + if (floor(dval) > ((double) LONG_MAX - 1)) { lval=LONG_MAX; break; } - if (dval < LONG_MIN) + if (ceil(dval) < ((double) LONG_MIN + 1)) { lval=LONG_MIN; break; @@ -4189,7 +4189,12 @@ MagickSpawnVP(const unsigned int verbose,const char *file, char *const argv[]) #if defined(HAVE_SPAWNVP) { /* int spawnvp(int mode, const char *path, const char * const *argv); */ - status = spawnvp(_P_WAIT, file, /*(const char * const *)*/ (char * const *) argv); +#if defined(__MINGW64_VERSION_MAJOR) + /* MinGW-w64 prototype is lacking */ + status = spawnvp(_P_WAIT, file, (char * const *) argv); +#else + status = spawnvp(_P_WAIT, file, (const char * const *) argv); +#endif } #else { @@ -4286,6 +4291,58 @@ MagickSpawnVP(const unsigned int verbose,const char *file, char *const argv[]) % % % % % % +% M a g i c k S t r i p S t r i n g % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Method MagickStripString strips any whitespace or quotes from the +% beginning and end of a string of characters. The final string length +% is returned. +% +% The format of the _MagickStripString method is: +% +% size_t _MagickStripString(char *message) +% +% A description of each parameter follows: +% +% o message: Specifies an array of characters. +% +% +*/ +MagickExport size_t MagickStripString(char *message) +{ + register char + *p, + *q; + + assert(message != (char *) NULL); + if (*message == '\0') + return 0; + if (strlen(message) == 1) + return 1; + p=message; + while (isspace((int)(unsigned char) (*p))) + p++; + if ((*p == '\'') || (*p == '"')) + p++; + q=message+strlen(message)-1; + while (isspace((int)(unsigned char) (*q)) && (q > p)) + q--; + if (q > p) + if ((*q == '\'') || (*q == '"')) + q--; + (void) memmove(message,p,q-p+1); + message[q-p+1]='\0'; + return (size_t) (q-p+1); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k S t r i p S p a c e s F r o m S t r i n g % % % % % @@ -5319,56 +5376,6 @@ MagickExport char **StringToList(const char *text) % % % % % % -% S t r i p % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Method Strip strips any whitespace or quotes from the beginning and end of -% a string of characters. -% -% The format of the Strip method is: -% -% void Strip(char *message) -% -% A description of each parameter follows: -% -% o message: Specifies an array of characters. -% -% -*/ -MagickExport void Strip(char *message) -{ - register char - *p, - *q; - - assert(message != (char *) NULL); - if (*message == '\0') - return; - if (strlen(message) == 1) - return; - p=message; - while (isspace((int)(unsigned char) (*p))) - p++; - if ((*p == '\'') || (*p == '"')) - p++; - q=message+strlen(message)-1; - while (isspace((int)(unsigned char) (*q)) && (q > p)) - q--; - if (q > p) - if ((*q == '\'') || (*q == '"')) - q--; - (void) memmove(message,p,q-p+1); - message[q-p+1]='\0'; -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + S u b s t i t u t e S t r i n g % % % % % @@ -6303,15 +6310,19 @@ MagickExport char *TranslateTextEx(const ImageInfo *image_info, } case 'x': { - /* Horizontal resolution */ - FormatString(buffer,"%g",image->x_resolution); + /* Horizontal resolution (default to 72.0 DPI if impossibly small) */ + FormatString(buffer,"%g", + fabs(image->x_resolution) > MagickEpsilon ? image->x_resolution : + (image->units == PixelsPerCentimeterResolution ? 72.0/2.54 : 72.0)); q+=(translate)(q,buffer,MaxTextExtent); break; } case 'y': { - /* Vertical resolution */ - FormatString(buffer,"%g",image->y_resolution); + /* Vertical resolution (default to 72.0 DPI if impossibly small) */ + FormatString(buffer,"%g", + fabs(image->y_resolution) > MagickEpsilon ? image->y_resolution : + (image->units == PixelsPerCentimeterResolution ? 72.0/2.54 : 72.0)); q+=(translate)(q,buffer,MaxTextExtent); break; } diff --git a/magick/utility.h b/magick/utility.h index 80bbda3..138008e 100644 --- a/magick/utility.h +++ b/magick/utility.h @@ -140,7 +140,7 @@ extern MagickExport void GetToken(const char *,char **,char *) MAGICK_FUNC_DEPRECATED, LocaleLower(char *), LocaleUpper(char *), - Strip(char *), + Strip(char *) MAGICK_FUNC_DEPRECATED, SetGeometry(const Image *,RectangleInfo *); extern MagickExport size_t @@ -155,7 +155,6 @@ extern MagickExport magick_int64_t extern MagickExport size_t MagickGetToken(const char *start,char **end,char *token, const size_t buffer_length), - MagickStripSpacesFromString(char *string), MagickStrlCat(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL, MagickStrlCpy(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL, MagickStrlCpyTrunc(char *dst, const char *src, const size_t size) MAGICK_FUNC_NONNULL; diff --git a/magick/version.h b/magick/version.h index 9bce058..3aad325 100644 --- a/magick/version.h +++ b/magick/version.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 - 2020 GraphicsMagick Group + Copyright (C) 2003 - 2022 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio Copyright 1991-1999 E. I. du Pont de Nemours and Company @@ -34,12 +34,12 @@ extern "C" { identifying the release. */ #define MagickPackageName "GraphicsMagick" -#define MagickCopyright "Copyright (C) 2002-2020 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details." -#define MagickLibVersion 0x252200 -#define MagickLibVersionText "1.3.36" -#define MagickLibVersionNumber 25,22,0 -#define MagickChangeDate "20201226" -#define MagickReleaseDate "20201226" +#define MagickCopyright "Copyright (C) 2002-2022 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details." +#define MagickLibVersion 0x272400 +#define MagickLibVersionText "1.3.38" +#define MagickLibVersionNumber 27,24,0 +#define MagickChangeDate "20220326" +#define MagickReleaseDate "2022-03-26" /* The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines @@ -54,7 +54,7 @@ extern "C" { MagickLibVersionNumber, but these are broken out and simplified so that they can be easily used in C pre-processor logic. */ -#define MagickLibInterfaceNewest 25 +#define MagickLibInterfaceNewest 27 #define MagickLibInterfaceOldest 3 #if (QuantumDepth == 8) diff --git a/magick/version.h.in b/magick/version.h.in index 841ae2d..84cab7d 100644 --- a/magick/version.h.in +++ b/magick/version.h.in @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 - 2020 GraphicsMagick Group + Copyright (C) 2003 - 2022 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio Copyright 1991-1999 E. I. du Pont de Nemours and Company @@ -34,7 +34,7 @@ extern "C" { identifying the release. */ #define MagickPackageName "@PACKAGE_NAME@" -#define MagickCopyright "Copyright (C) 2002-2020 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details." +#define MagickCopyright "Copyright (C) 2002-2022 GraphicsMagick Group.\nAdditional copyrights and licenses apply to this software.\nSee http://www.GraphicsMagick.org/www/Copyright.html for details." #define MagickLibVersion @MAGICK_LIB_VERSION@ #define MagickLibVersionText "@MAGICK_LIB_VERSION_TEXT@" #define MagickLibVersionNumber @MAGICK_LIB_VERSION_NUMBER@ diff --git a/magick/widget.c b/magick/widget.c index 6940ce8..9cd815b 100644 --- a/magick/widget.c +++ b/magick/widget.c @@ -8426,7 +8426,7 @@ unsigned int MagickXPreferencesWidget(Display *display, #define CancelButtonText "Cancel" #define NumberPreferences 7 static const char - Preferences[NumberPreferences][47] = + Preferences[NumberPreferences][48] = { "display image centered on a backdrop", "confirm on program exit", |