diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index c0b4fd3d9..ac886557b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -43,6 +43,7 @@ body: description: List of steps, sample code, failing test or link to a project that reproduces the behavior. Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues. validations: required: true -- type: markdown +- type: textarea attributes: - value: Please upload images that can be used to reproduce issues in the area below. If the file type is not supported the file can be zipped and then uploaded instead. \ No newline at end of file + label: Images + description: Please upload images that can be used to reproduce issues in the area below. If the file type is not supported the file can be zipped and then uploaded instead. \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index 255006ba0..2fb3bcd00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-04-10 7.0.11-7 + * Release ImageMagick version 7.0.11-7 GIT revision 18617:2a0925961:20210411 + +2021-04-09 7.0.11-7 + * constrain sub-image list. + * -layers optimize no longer produces broken output (reference + https://github.com/ImageMagick/ImageMagick/issues/3520). + 2021-04-03 7.0.11-6 * Release ImageMagick version 7.0.11-6 GIT revision 18588:ea711b44c:20210403 diff --git a/MagickCore/animate.c b/MagickCore/animate.c index 11c9480e3..32c62c759 100644 --- a/MagickCore/animate.c +++ b/MagickCore/animate.c @@ -1981,7 +1981,7 @@ MagickExport Image *XAnimateImages(Display *display, else { char - window_name[MaxTextExtent]; + window_name[MagickPathExtent]; p=image_list[scene]->magick_filename+ strlen(image_list[scene]->magick_filename)-1; @@ -2101,7 +2101,7 @@ MagickExport Image *XAnimateImages(Display *display, (resource_info->title != (char *) NULL)) { char - name[MaxTextExtent]; + name[MagickPathExtent]; /* Update window title. diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index 5ae318e7e..d3e4516c2 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -661,7 +661,7 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, char magick_path[MagickPathExtent], *property, - timestamp[MagickPathExtent]; + timestamp[MagickTimeExtent]; const char *option; @@ -815,10 +815,10 @@ MagickExport Image *ReadImage(const ImageInfo *image_info, if (source_date_epoch == (const char *) NULL) { (void) FormatMagickTime((time_t) GetBlobProperties(next)->st_mtime, - MagickPathExtent,timestamp); + sizeof(timestamp),timestamp); (void) SetImageProperty(next,"date:modify",timestamp,exception); (void) FormatMagickTime((time_t) GetBlobProperties(next)->st_ctime, - MagickPathExtent,timestamp); + sizeof(timestamp),timestamp); (void) SetImageProperty(next,"date:create",timestamp,exception); } option=GetImageOption(image_info,"delay"); diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index f430609ff..bef9abcd3 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -919,7 +919,7 @@ static char *InterpretDelegateProperties(ImageInfo *image_info, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ return((char *) NULL); \ q=interpret_text+strlen(interpret_text); \ @@ -933,7 +933,7 @@ static char *InterpretDelegateProperties(ImageInfo *image_info, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ return((char *) NULL); \ q=interpret_text+strlen(interpret_text); \ @@ -948,7 +948,7 @@ static char *InterpretDelegateProperties(ImageInfo *image_info, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ return((char *) NULL); \ q=interpret_text+strlen(interpret_text); \ diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 541c8f592..e0d89403c 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -2273,20 +2273,20 @@ static MagickBooleanType CheckPrimitiveExtent(MVGInfo *mvg_info, Check if there is enough storage for drawing pimitives. */ quantum=sizeof(**mvg_info->primitive_info); - extent=(double) mvg_info->offset+pad+PrimitiveExtentPad*quantum+1.0; + extent=(double) mvg_info->offset+pad+(PrimitiveExtentPad+1)*quantum; if (extent <= (double) *mvg_info->extent) return(MagickTrue); if (extent == (double) CastDoubleToLong(extent)) { *mvg_info->primitive_info=(PrimitiveInfo *) ResizeQuantumMemory( - *mvg_info->primitive_info,(size_t) extent,quantum); + *mvg_info->primitive_info,(size_t) (extent+1),quantum); if (*mvg_info->primitive_info != (PrimitiveInfo *) NULL) { ssize_t i; *mvg_info->extent=(size_t) extent; - for (i=mvg_info->offset+1; i < (ssize_t) extent; i++) + for (i=mvg_info->offset+1; i <= (ssize_t) extent; i++) (*mvg_info->primitive_info)[i].primitive=UndefinedPrimitive; return(MagickTrue); } @@ -2300,8 +2300,8 @@ static MagickBooleanType CheckPrimitiveExtent(MVGInfo *mvg_info, *mvg_info->primitive_info=(PrimitiveInfo *) RelinquishMagickMemory( *mvg_info->primitive_info); *mvg_info->primitive_info=(PrimitiveInfo *) AcquireCriticalMemory((size_t) ( - PrimitiveExtentPad*quantum)); - (void) memset(*mvg_info->primitive_info,0,(size_t) (PrimitiveExtentPad* + (PrimitiveExtentPad+1)*quantum)); + (void) memset(*mvg_info->primitive_info,0,(size_t) ((PrimitiveExtentPad+1)* quantum)); *mvg_info->extent=1; mvg_info->offset=0; @@ -2573,8 +2573,8 @@ static MagickBooleanType RenderMVGContent(Image *image, image->filename); } number_points=(size_t) PrimitiveExtentPad; - primitive_info=(PrimitiveInfo *) AcquireQuantumMemory((size_t) number_points, - sizeof(*primitive_info)); + primitive_info=(PrimitiveInfo *) AcquireQuantumMemory((size_t) + (number_points+1),sizeof(*primitive_info)); if (primitive_info == (PrimitiveInfo *) NULL) { primitive=DestroyString(primitive); @@ -2584,7 +2584,7 @@ static MagickBooleanType RenderMVGContent(Image *image, ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } - (void) memset(primitive_info,0,(size_t) number_points* + (void) memset(primitive_info,0,(size_t) (number_points+1)* sizeof(*primitive_info)); (void) memset(&mvg_info,0,sizeof(mvg_info)); mvg_info.primitive_info=(&primitive_info); diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index 5c6e2ad69..b0de9d3c3 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -462,14 +462,14 @@ MagickExport char *GetPageGeometry(const char *page_geometry) }; char - page[MaxTextExtent]; + page[MagickPathExtent]; ssize_t i; assert(page_geometry != (char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",page_geometry); - (void) CopyMagickString(page,page_geometry,MaxTextExtent); + (void) CopyMagickString(page,page_geometry,MagickPathExtent); for (i=0; i < (ssize_t) (sizeof(PageSizes)/sizeof(PageSizes[0])); i++) { int @@ -487,12 +487,12 @@ MagickExport char *GetPageGeometry(const char *page_geometry) /* Replace mneumonic with the equivalent size in dots-per-inch. */ - (void) FormatLocaleString(page,MaxTextExtent,"%s%.80s", + (void) FormatLocaleString(page,MagickPathExtent,"%s%.80s", PageSizes[i].geometry,page_geometry+PageSizes[i].extent); flags=GetGeometry(page,&geometry.x,&geometry.y,&geometry.width, &geometry.height); if ((flags & GreaterValue) == 0) - (void) ConcatenateMagickString(page,">",MaxTextExtent); + (void) ConcatenateMagickString(page,">",MagickPathExtent); break; } } diff --git a/MagickCore/layer.c b/MagickCore/layer.c index 04851c0d2..868b40da5 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -39,6 +39,7 @@ */ #include "MagickCore/studio.h" #include "MagickCore/artifact.h" +#include "MagickCore/attribute.h" #include "MagickCore/cache.h" #include "MagickCore/channel.h" #include "MagickCore/color.h" @@ -1574,10 +1575,9 @@ MagickExport void OptimizeImageTransparency(const Image *image, Optimize Transparency of the next frame (if present) */ next=GetNextImageInList(next); - if (next != (Image *) NULL) { + if (next != (Image *) NULL) (void) CompositeImage(next,dispose_image,ChangeMaskCompositeOp, MagickTrue,-(next->page.x),-(next->page.y),exception); - } } dispose_image=DestroyImage(dispose_image); return; diff --git a/MagickCore/list.c b/MagickCore/list.c index eae908f76..1caabc02f 100644 --- a/MagickCore/list.c +++ b/MagickCore/list.c @@ -248,24 +248,12 @@ MagickExport Image *CloneImages(const Image *images,const char *scenes, while ((isspace((int) ((unsigned char) *p)) != 0) || (*p == ',')) p++; - first=(ssize_t) strtol(p,&p,10); - if (first < 0) - first+=(ssize_t) length; - else - if (first > (ssize_t) length) - first=(ssize_t) length; + first=(ssize_t) strtol(p,&p,10) % (length << 1); last=first; while (isspace((int) ((unsigned char) *p)) != 0) p++; if (*p == '-') - { - last=(ssize_t) strtol(p+1,&p,10); - if (last < 0) - last+=(ssize_t) length; - else - if (last > (ssize_t) length) - last=(ssize_t) length; - } + last=(ssize_t) strtol(p+1,&p,10) % (length << 1); match=MagickFalse; step=1; if (artifact != (const char *) NULL) diff --git a/MagickCore/log.c b/MagickCore/log.c index 2c34e8b0e..1e35b4ddb 100644 --- a/MagickCore/log.c +++ b/MagickCore/log.c @@ -1231,12 +1231,12 @@ static char *TranslateEvent(const char *module,const char *function, if (LocaleCompare(log_info->format,"xml") == 0) { char - timestamp[MagickPathExtent]; + timestamp[MagickTimeExtent]; /* Translate event in "XML" format. */ - (void) FormatMagickTime(seconds,extent,timestamp); + (void) FormatMagickTime(seconds,sizeof(timestamp),timestamp); (void) FormatLocaleString(text,extent, "\n" " %s\n" diff --git a/MagickCore/method-attribute.h b/MagickCore/method-attribute.h index f8304d53d..c03617ba6 100644 --- a/MagickCore/method-attribute.h +++ b/MagickCore/method-attribute.h @@ -88,6 +88,7 @@ extern "C" { # define MagickPathExtent 4096 /* always >= 4096 */ #endif #define MaxTextExtent MagickPathExtent +#define MagickTimeExtent 26 #if defined(MAGICKCORE_HAVE___ATTRIBUTE__) # define magick_aligned(x,y) x __attribute__((aligned(y))) diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c index dc99f9a98..446feb656 100644 --- a/MagickCore/opencl.c +++ b/MagickCore/opencl.c @@ -219,7 +219,7 @@ static inline MagickBooleanType MagickCreateDirectory(const char *path) #ifdef MAGICKCORE_WINDOWS_SUPPORT status=mkdir(path); #else - status=mkdir(path, 0777); + status=mkdir(path,0777); #endif return(status == 0 ? MagickTrue : MagickFalse); } @@ -825,7 +825,7 @@ static void LoadOpenCLDeviceBenchmark(MagickCLEnv clEnv,const char *xml) { if (device_benchmark->score != MAGICKCORE_OPENCL_UNDEFINED_SCORE) { - if (LocaleCompare(device_benchmark->name, "CPU") == 0) + if (LocaleCompare(device_benchmark->name,"CPU") == 0) clEnv->cpu_score=device_benchmark->score; else { @@ -2169,7 +2169,7 @@ static MagickBooleanType HasOpenCLDevices(MagickCLEnv clEnv, return(MagickTrue); /* Get additional options */ - (void) FormatLocaleString(options,MaxTextExtent,CLOptions, + (void) FormatLocaleString(options,MagickPathExtent,CLOptions, (float)QuantumRange,(float)QuantumScale,(float)CLCharQuantumScale, (float)MagickEpsilon,(float)MagickPI,(unsigned int)MaxMap, (unsigned int)MAGICKCORE_QUANTUM_DEPTH); @@ -2249,7 +2249,7 @@ static cl_uint GetOpenCLDeviceCount(MagickCLEnv clEnv,cl_platform_id platform) if (clEnv->library->clGetPlatformInfo(platform,CL_PLATFORM_VERSION, MagickPathExtent,version,NULL) != CL_SUCCESS) return(0); - if (strncmp(version, "OpenCL 1.0 ", 11) == 0) + if (strncmp(version,"OpenCL 1.0 ",11) == 0) return(0); if (clEnv->library->clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU|CL_DEVICE_TYPE_GPU,0,NULL,&num) != CL_SUCCESS) @@ -2257,6 +2257,36 @@ static cl_uint GetOpenCLDeviceCount(MagickCLEnv clEnv,cl_platform_id platform) return(num); } +static inline char *GetOpenCLPlatformString(cl_platform_id platform, + cl_platform_info param_name) +{ + char + *value; + + size_t + length; + + openCL_library->clGetPlatformInfo(platform,param_name,0,NULL,&length); + value=AcquireCriticalMemory(length*sizeof(*value)); + openCL_library->clGetPlatformInfo(platform,param_name,length,value,NULL); + return(value); +} + +static inline char *GetOpenCLDeviceString(cl_device_id device, + cl_device_info param_name) +{ + char + *value; + + size_t + length; + + openCL_library->clGetDeviceInfo(device,param_name,0,NULL,&length); + value=AcquireCriticalMemory(length*sizeof(*value)); + openCL_library->clGetDeviceInfo(device,param_name,length,value,NULL); + return(value); +} + static void LoadOpenCLDevices(MagickCLEnv clEnv) { cl_context_properties @@ -2297,11 +2327,20 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) } for (i = 0; i < number_platforms; i++) { - number_devices=GetOpenCLDeviceCount(clEnv,platforms[i]); + char + *platform_name; + + number_devices=0; + platform_name=GetOpenCLPlatformString(platforms[i],CL_PLATFORM_NAME); + /* NVIDIA is disabled by default due to reported access violation */ + if (strncmp(platform_name,"NVIDIA",6) != 0) + { + number_devices=GetOpenCLDeviceCount(clEnv,platforms[i]); + clEnv->number_devices+=number_devices; + } + platform_name=(char *) RelinquishMagickMemory(platform_name); if (number_devices == 0) platforms[i]=(cl_platform_id) NULL; - else - clEnv->number_devices+=number_devices; } if (clEnv->number_devices == 0) { @@ -2316,8 +2355,7 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) platforms=(cl_platform_id *) RelinquishMagickMemory(platforms); return; } - (void) memset(clEnv->devices,0,clEnv->number_devices* - sizeof(MagickCLDevice)); + (void) memset(clEnv->devices,0,clEnv->number_devices*sizeof(MagickCLDevice)); devices=(cl_device_id *) AcquireQuantumMemory(clEnv->number_devices, sizeof(cl_device_id)); if (devices == (cl_device_id *) NULL) @@ -2326,6 +2364,7 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) RelinquishMagickCLDevices(clEnv); return; } + (void) memset(devices,0,clEnv->number_devices*sizeof(cl_device_id)); clEnv->number_contexts=(size_t) number_platforms; clEnv->contexts=(cl_context *) AcquireQuantumMemory(clEnv->number_contexts, sizeof(cl_context)); @@ -2336,6 +2375,7 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) RelinquishMagickCLDevices(clEnv); return; } + (void) memset(clEnv->contexts,0,clEnv->number_contexts*sizeof(cl_context)); next=0; for (i = 0; i < number_platforms; i++) { @@ -2367,31 +2407,15 @@ static void LoadOpenCLDevices(MagickCLEnv clEnv) device->context=clEnv->contexts[i]; device->deviceID=devices[j]; - openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_NAME,0,NULL, - &length); - device->platform_name=AcquireCriticalMemory(length* - sizeof(*device->platform_name)); - openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_NAME,length, - device->platform_name,NULL); - - openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_VENDOR,0,NULL, - &length); - device->vendor_name=AcquireCriticalMemory(length* - sizeof(*device->vendor_name)); - openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_VENDOR,length, - device->vendor_name,NULL); - - openCL_library->clGetDeviceInfo(devices[j],CL_DEVICE_NAME,0,NULL, - &length); - device->name=AcquireCriticalMemory(length*sizeof(*device->name)); - openCL_library->clGetDeviceInfo(devices[j],CL_DEVICE_NAME,length, - device->name,NULL); - - openCL_library->clGetDeviceInfo(devices[j],CL_DRIVER_VERSION,0,NULL, - &length); - device->version=AcquireCriticalMemory(length*sizeof(*device->version)); - openCL_library->clGetDeviceInfo(devices[j],CL_DRIVER_VERSION,length, - device->version,NULL); + device->platform_name=GetOpenCLPlatformString(platforms[i], + CL_PLATFORM_NAME); + + device->vendor_name=GetOpenCLPlatformString(platforms[i], + CL_PLATFORM_VENDOR); + + device->name=GetOpenCLDeviceString(devices[j],CL_DEVICE_NAME); + + device->version=GetOpenCLDeviceString(devices[j],CL_DRIVER_VERSION); openCL_library->clGetDeviceInfo(devices[j],CL_DEVICE_MAX_CLOCK_FREQUENCY, sizeof(cl_uint),&device->max_clock_frequency,NULL); @@ -2485,7 +2509,7 @@ static MagickBooleanType BindOpenCLFunctions() #ifdef MAGICKCORE_WINDOWS_SUPPORT openCL_library->library=(void *)LoadLibraryA("OpenCL.dll"); #else - openCL_library->library=(void *)dlopen("libOpenCL.so", RTLD_NOW); + openCL_library->library=(void *)dlopen("libOpenCL.so",RTLD_NOW); #endif #define BIND(X) \ if ((openCL_library->X=(MAGICKpfn_##X)OsLibraryGetFunctionAddress(openCL_library->library,#X)) == NULL) \ @@ -2652,7 +2676,7 @@ MagickPrivate MagickBooleanType OpenCLThrowMagickException( { /* Workaround for Intel OpenCL CPU runtime bug */ /* Turn off OpenCL when a problem is detected! */ - if (strncmp(device->platform_name, "Intel",5) == 0) + if (strncmp(device->platform_name,"Intel",5) == 0) default_CLEnv->enabled=MagickFalse; } } diff --git a/MagickCore/property.c b/MagickCore/property.c index 3e0d9f181..7205c292c 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -2893,7 +2893,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info, { WarnNoImageReturn("\"%%[%s]\"",property); image->colors=GetNumberColors(image,(FILE *) NULL,exception); - (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double) + (void) FormatLocaleString(value,MagickPathExtent,"%.20g",(double) image->colors); break; } @@ -3192,7 +3192,7 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info, page; (void) ParseAbsoluteGeometry(papersize,&page); - (void) FormatLocaleString(value,MaxTextExtent,"%.20gx%.20g", + (void) FormatLocaleString(value,MagickPathExtent,"%.20gx%.20g", (double) page.width,(double) page.height); } break; @@ -3522,7 +3522,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ { \ if (property_image != image) \ @@ -3542,7 +3542,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ { \ if (property_image != image) \ @@ -3563,7 +3563,7 @@ MagickExport char *InterpretImageProperties(ImageInfo *image_info,Image *image, { \ extent+=length; \ interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+ \ - MaxTextExtent,sizeof(*interpret_text)); \ + MagickPathExtent,sizeof(*interpret_text)); \ if (interpret_text == (char *) NULL) \ { \ if (property_image != image) \ diff --git a/MagickCore/xml-tree-private.h b/MagickCore/xml-tree-private.h index 9f409aa80..962051b6b 100644 --- a/MagickCore/xml-tree-private.h +++ b/MagickCore/xml-tree-private.h @@ -18,8 +18,8 @@ #ifndef MAGICKCORE_XML_TREE_PRIVATE_H #define MAGICKCORE_XML_TREE_PRIVATE_H -#include "MagickCore/exception.h" #include "MagickCore/splay-tree.h" +#include "MagickCore/xml-tree.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 2ee25ddde..950ae0f22 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -130,7 +130,7 @@ WandExport MagickBooleanType MagickCommandGenesis(ImageInfo *image_info, ExceptionInfo *exception) { char - client_name[MaxTextExtent], + client_name[MagickPathExtent], *option; double diff --git a/coders/cin.c b/coders/cin.c index b62cafd1c..fbc8aa1fc 100644 --- a/coders/cin.c +++ b/coders/cin.c @@ -996,7 +996,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image, seconds=GetMagickTime(); GetMagickUTCtime(&seconds,&utc_time); (void) memset(timestamp,0,sizeof(timestamp)); - (void) strftime(timestamp,MaxTextExtent,"%Y:%m:%d:%H:%M:%SUTC",&utc_time); + (void) strftime(timestamp,MagickPathExtent,"%Y:%m:%d:%H:%M:%SUTC",&utc_time); (void) memset(cin.file.create_date,0,sizeof(cin.file.create_date)); (void) CopyMagickString(cin.file.create_date,timestamp,11); offset+=WriteBlob(image,sizeof(cin.file.create_date),(unsigned char *) @@ -1093,7 +1093,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image, offset+=WriteBlob(image,sizeof(cin.origination.filename),(unsigned char *) cin.origination.filename); (void) memset(timestamp,0,sizeof(timestamp)); - (void) strftime(timestamp,MaxTextExtent,"%Y:%m:%d:%H:%M:%SUTC",&utc_time); + (void) strftime(timestamp,MagickPathExtent,"%Y:%m:%d:%H:%M:%SUTC",&utc_time); (void) memset(cin.origination.create_date,0, sizeof(cin.origination.create_date)); (void) CopyMagickString(cin.origination.create_date,timestamp,11); diff --git a/coders/clipboard.c b/coders/clipboard.c index d7ea80352..655d7c80c 100644 --- a/coders/clipboard.c +++ b/coders/clipboard.c @@ -200,7 +200,7 @@ static Image *ReadCLIPBOARDImage(const ImageInfo *image_info, p[5]=(unsigned char) (total_size >> 24); p[10]=offset; read_info=CloneImageInfo(image_info); - (void) CopyMagickString(read_info->magick,"BMP",MaxTextExtent); + (void) CopyMagickString(read_info->magick,"BMP",MagickPathExtent); image=BlobToImage(read_info,clip_data,total_size,exception); read_info=DestroyImageInfo(read_info); clip_data=RelinquishMagickMemory(clip_data); @@ -330,9 +330,9 @@ static MagickBooleanType WriteCLIPBOARDImage(const ImageInfo *image_info, ThrowWriterException(CoderError,"UnableToWriteImageData"); write_info=CloneImageInfo(image_info); if (image->alpha_trait == UndefinedPixelTrait) - (void) CopyMagickString(write_info->magick,"BMP3",MaxTextExtent); + (void) CopyMagickString(write_info->magick,"BMP3",MagickPathExtent); else - (void) CopyMagickString(write_info->magick,"BMP",MaxTextExtent); + (void) CopyMagickString(write_info->magick,"BMP",MagickPathExtent); clip_data=ImageToBlob(write_info,image,&length,exception); write_info=DestroyImageInfo(write_info); if (clip_data == (void *) NULL) diff --git a/coders/dng.c b/coders/dng.c index af0f8a29e..ba09bcacc 100644 --- a/coders/dng.c +++ b/coders/dng.c @@ -163,12 +163,12 @@ static void SetDNGProperties(Image *image,const libraw_data_t *raw_info, ExceptionInfo *exception) { char - timestamp[MagickPathExtent]; + timestamp[MagickTimeExtent]; (void) SetImageProperty(image,"dng:make",raw_info->idata.make,exception); (void) SetImageProperty(image,"dng:camera.model.name",raw_info->idata.model, exception); - (void) FormatMagickTime(raw_info->other.timestamp,MagickPathExtent,timestamp); + (void) FormatMagickTime(raw_info->other.timestamp,sizeof(timestamp),timestamp); (void) SetImageProperty(image,"dng:create.date",timestamp,exception); (void) FormatImageProperty(image,"dng:iso.setting","%0.1f", raw_info->other.iso_speed); diff --git a/coders/dot.c b/coders/dot.c index 252308cd3..4e0084bbc 100644 --- a/coders/dot.c +++ b/coders/dot.c @@ -159,7 +159,7 @@ static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read SVG graph. */ - (void) CopyMagickString(read_info->magick,"SVG",MaxTextExtent); + (void) CopyMagickString(read_info->magick,"SVG",MagickPathExtent); image=ReadImage(read_info,exception); (void) RelinquishUniqueFileResource(read_info->filename); read_info=DestroyImageInfo(read_info); diff --git a/coders/json.c b/coders/json.c index f40ebdad5..27e929b4c 100644 --- a/coders/json.c +++ b/coders/json.c @@ -998,7 +998,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (LocaleCompare(image->magick_filename,image->filename) != 0) { char - filename[MaxTextExtent]; + filename[MagickPathExtent]; GetPathComponent(image->magick_filename,TailPath,filename); JSONFormatLocaleFile(file," \"baseName\": %s,\n",filename); diff --git a/coders/mpc.c b/coders/mpc.c index 407b93599..98ca23207 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -10,7 +10,7 @@ % M M P CCCC % % % % % -% Read/Write Magick Persistant Cache Image Format % +% Read/Write Magick Pixel Cache Image Format % % % % Software Design % % Cristy % @@ -74,6 +74,11 @@ #include "MagickCore/utility.h" #include "MagickCore/version-private.h" +/* + Define declarations. +*/ +#define MagickPixelCacheNonce "MagickPixelCache" + /* Forward declarations. */ @@ -92,7 +97,7 @@ static MagickBooleanType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % IsMPC() returns MagickTrue if the image format type, identified by the -% magick string, is an Magick Persistent Cache image. +% magick string, is an Magick Pixel Cache image. % % The format of the IsMPC method is: % @@ -125,7 +130,7 @@ static MagickBooleanType IsMPC(const unsigned char *magick,const size_t length) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% ReadMPCImage() reads an Magick Persistent Cache image file and returns +% ReadMPCImage() reads an Magick Pixel Cache image file and returns % it. It allocates the memory necessary for the new Image structure and % returns a pointer to the new image. % @@ -185,6 +190,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) ssize_t count; + StringInfo + *nonce; + unsigned int signature; @@ -225,7 +233,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) profiles=(LinkedListInfo *) NULL; length=MagickPathExtent; options=AcquireString((char *) NULL); - signature=GetMagickSignature((const StringInfo *) NULL); + nonce=StringToStringInfo(MagickPixelCacheNonce); + signature=GetMagickSignature(nonce); + nonce=DestroyStringInfo(nonce); image->depth=8; image->compression=NoCompression; while ((isgraph((int) ((unsigned char) c)) != 0) && (c != (int) ':')) @@ -796,12 +806,15 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) profiles=DestroyLinkedList(profiles,RelinquishMagickMemory); ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } - if (signature != GetMagickSignature((const StringInfo *) NULL)) + nonce=StringToStringInfo(MagickPixelCacheNonce); + if (signature != GetMagickSignature(nonce)) { + nonce=DestroyStringInfo(nonce); if (profiles != (LinkedListInfo *) NULL) profiles=DestroyLinkedList(profiles,RelinquishMagickMemory); ThrowReaderException(CacheError,"IncompatibleAPI"); } + nonce=DestroyStringInfo(nonce); if (image->montage != (char *) NULL) { char @@ -1059,11 +1072,10 @@ ModuleExport size_t RegisterMPCImage(void) MagickInfo *entry; - entry=AcquireMagickInfo("MPC","CACHE", - "Magick Persistent Cache image format"); + entry=AcquireMagickInfo("MPC","CACHE","Magick Pixel Cache image format"); entry->flags|=CoderStealthFlag; (void) RegisterMagickInfo(entry); - entry=AcquireMagickInfo("MPC","MPC","Magick Persistent Cache image format"); + entry=AcquireMagickInfo("MPC","MPC","Magick Pixel Cache image format"); entry->decoder=(DecodeImageHandler *) ReadMPCImage; entry->encoder=(EncodeImageHandler *) WriteMPCImage; entry->magick=(IsImageFormatHandler *) IsMPC; @@ -1108,7 +1120,7 @@ ModuleExport void UnregisterMPCImage(void) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% WriteMPCImage() writes an Magick Persistent Cache image to a file. +% WriteMPCImage() writes an Magick Pixel Cache image to a file. % % The format of the WriteMPCImage method is: % @@ -1170,8 +1182,11 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image, imageListLength=GetImageListLength(image); do { + StringInfo + *nonce; + /* - Write persistent cache meta-information. + Write cache meta-information. SetImageStorageClass() required to sync pixel cache. */ @@ -1181,8 +1196,10 @@ static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image, (image->colors > (size_t) (GetQuantumRange(image->depth)+1))) (void) SetImageStorageClass(image,DirectClass,exception); (void) WriteBlobString(image,"id=MagickPixelCache\n"); + nonce=StringToStringInfo(MagickPixelCacheNonce); (void) FormatLocaleString(buffer,MagickPathExtent,"magick-signature=%u\n", - GetMagickSignature((const StringInfo *) NULL)); + GetMagickSignature(nonce)); + nonce=DestroyStringInfo(nonce); (void) WriteBlobString(image,buffer); (void) FormatLocaleString(buffer,MagickPathExtent, "class=%s colors=%.20g alpha-trait=%s\n",CommandOptionToMnemonic( diff --git a/coders/ora.c b/coders/ora.c index 1a15ddea0..46ff7d405 100644 --- a/coders/ora.c +++ b/coders/ora.c @@ -105,10 +105,8 @@ extern "C" { static Image *ReadORAImage(const ImageInfo *image_info, ExceptionInfo *exception) { -#define MaxBufferExtent 8192 - char - image_data_buffer[MaxBufferExtent]; + image_data_buffer[8192]; const char *MERGED_IMAGE_PATH = "mergedimage.png"; @@ -146,8 +144,8 @@ static Image *ReadORAImage(const ImageInfo *image_info, image_metadata=AcquireImage(image_info,exception); read_info=CloneImageInfo(image_info); SetImageInfoBlob(read_info,(void *) NULL,0); - stat(image_info->filename, &stat_info); - zip_archive=zip_open(image_info->filename, ZIP_RDONLY, &zip_error); + stat(image_info->filename,&stat_info); + zip_archive=zip_open(image_info->filename,ZIP_RDONLY,&zip_error); if (zip_archive == NULL) { ThrowFileException(exception,FileOpenError,"UnableToOpenFile", @@ -192,7 +190,7 @@ static Image *ReadORAImage(const ImageInfo *image_info, while (status != MagickFalse) { read_bytes=zip_fread(merged_image_file,image_data_buffer+offset, - MaxBufferExtent-offset); + sizeof(image_data_buffer)-offset); if (read_bytes == -1) status=MagickFalse; else if (read_bytes == 0) @@ -202,10 +200,10 @@ static Image *ReadORAImage(const ImageInfo *image_info, status=MagickFalse; break; } - else if (read_bytes == MaxBufferExtent-offset) + else if (read_bytes == sizeof(image_data_buffer)-offset) { /* Write the entirely of image_data_buffer to temp file */ - if (!fwrite(image_data_buffer,MaxBufferExtent,1,file)) + if (!fwrite(image_data_buffer,sizeof(image_data_buffer),1,file)) status=MagickFalse; else offset=0; diff --git a/coders/pdf.c b/coders/pdf.c index 7792d417a..3c658113b 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -1219,9 +1219,8 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, basename[MagickPathExtent], buffer[MagickPathExtent], *escape, - date[MagickPathExtent], **labels, - page_geometry[MagickPathExtent], + temp[MagickPathExtent], *url; CompressionType @@ -1402,10 +1401,9 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, if (LocaleCompare(image_info->magick,"PDFA") == 0) { char - create_date[MagickPathExtent], - modify_date[MagickPathExtent], - timestamp[MagickPathExtent], - xmp_profile[MagickPathExtent]; + create_date[MagickTimeExtent], + modify_date[MagickTimeExtent], + timestamp[MagickTimeExtent]; /* Write XMP object. @@ -1419,15 +1417,15 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, *modify_date='\0'; value=GetImageProperty(image,"date:modify",exception); if (value != (const char *) NULL) - (void) CopyMagickString(modify_date,value,MagickPathExtent); + (void) CopyMagickString(modify_date,value,sizeof(modify_date)); *create_date='\0'; value=GetImageProperty(image,"date:create",exception); if (value != (const char *) NULL) - (void) CopyMagickString(create_date,value,MagickPathExtent); - (void) FormatMagickTime(GetMagickTime(),MagickPathExtent,timestamp); + (void) CopyMagickString(create_date,value,sizeof(create_date)); + (void) FormatMagickTime(GetMagickTime(),sizeof(timestamp),timestamp); url=(char *) MagickAuthoritativeURL; escape=EscapeParenthesis(basename); - i=FormatLocaleString(xmp_profile,MagickPathExtent,XMPProfile, + i=FormatLocaleString(temp,MagickPathExtent,XMPProfile, XMPProfileMagick,modify_date,create_date,timestamp,url,escape,url); escape=DestroyString(escape); (void) FormatLocaleString(buffer,MagickPathExtent,"/Length %.20g\n", @@ -1435,7 +1433,7 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"/Type /Metadata\n"); (void) WriteBlobString(image,">>\nstream\n"); - (void) WriteBlobString(image,xmp_profile); + (void) WriteBlobString(image,temp); (void) WriteBlobString(image,"\nendstream\n"); (void) WriteBlobString(image,"endobj\n"); } @@ -1587,29 +1585,29 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, resolution.y=(double) ((size_t) (100.0*2.54*resolution.y+0.5)/100.0); } SetGeometry(image,&geometry); - (void) FormatLocaleString(page_geometry,MagickPathExtent,"%.20gx%.20g", + (void) FormatLocaleString(temp,MagickPathExtent,"%.20gx%.20g", (double) image->columns,(double) image->rows); if (image_info->page != (char *) NULL) - (void) CopyMagickString(page_geometry,image_info->page,MagickPathExtent); + (void) CopyMagickString(temp,image_info->page,MagickPathExtent); else if ((image->page.width != 0) && (image->page.height != 0)) - (void) FormatLocaleString(page_geometry,MagickPathExtent, + (void) FormatLocaleString(temp,MagickPathExtent, "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double) image->page.height,(double) image->page.x,(double) image->page.y); else if ((image->gravity != UndefinedGravity) && (LocaleCompare(image_info->magick,"PDF") == 0)) - (void) CopyMagickString(page_geometry,PSPageGeometry, + (void) CopyMagickString(temp,PSPageGeometry, MagickPathExtent); - (void) ConcatenateMagickString(page_geometry,">",MagickPathExtent); - (void) ParseMetaGeometry(page_geometry,&geometry.x,&geometry.y, + (void) ConcatenateMagickString(temp,">",MagickPathExtent); + (void) ParseMetaGeometry(temp,&geometry.x,&geometry.y, &geometry.width,&geometry.height); scale.x=(double) (geometry.width*delta.x)/resolution.x; geometry.width=(size_t) floor(scale.x+0.5); scale.y=(double) (geometry.height*delta.y)/resolution.y; geometry.height=(size_t) floor(scale.y+0.5); - (void) ParseAbsoluteGeometry(page_geometry,&media_info); - (void) ParseGravityGeometry(image,page_geometry,&page_info,exception); + (void) ParseAbsoluteGeometry(temp,&media_info); + (void) ParseGravityGeometry(image,temp,&page_info,exception); if (image->gravity != UndefinedGravity) { geometry.x=(-page_info.x); @@ -2997,13 +2995,13 @@ static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image, (void) WriteBlobString(image,buffer); seconds=GetMagickTime(); GetMagickUTCtime(&seconds,&utc_time); - (void) FormatLocaleString(date,MagickPathExtent,"D:%04d%02d%02d%02d%02d%02d", + (void) FormatLocaleString(temp,MagickPathExtent,"D:%04d%02d%02d%02d%02d%02d", utc_time.tm_year+1900,utc_time.tm_mon+1,utc_time.tm_mday, utc_time.tm_hour,utc_time.tm_min,utc_time.tm_sec); (void) FormatLocaleString(buffer,MagickPathExtent,"/CreationDate (%s)\n", - date); + temp); (void) WriteBlobString(image,buffer); - (void) FormatLocaleString(buffer,MagickPathExtent,"/ModDate (%s)\n",date); + (void) FormatLocaleString(buffer,MagickPathExtent,"/ModDate (%s)\n",temp); (void) WriteBlobString(image,buffer); url=(char *) MagickAuthoritativeURL; escape=EscapeParenthesis(url); diff --git a/coders/pict.c b/coders/pict.c index 6e1972aba..927df36d6 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -1495,7 +1495,7 @@ static Image *ReadPICTImage(const ImageInfo *image_info, ThrowPICTException(CorruptImageError,"ImproperImageHeader"); } read_info=AcquireImageInfo(); - (void) FormatLocaleString(read_info->filename,MaxTextExtent, + (void) FormatLocaleString(read_info->filename,MagickPathExtent, "jpeg:%s",image_info->filename); tile_image=BlobToImage(read_info,stream,count,exception); pixels=(unsigned char *) RelinquishMagickMemory(pixels); diff --git a/coders/png.c b/coders/png.c index aea0ea166..fe1d9f862 100644 --- a/coders/png.c +++ b/coders/png.c @@ -3823,8 +3823,10 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, for (x=0; x < ping_num_trans; x++) { image->colormap[x].alpha_trait=BlendPixelTrait; - image->colormap[x].alpha = - ScaleCharToQuantum((unsigned char)ping_trans_alpha[x]); + image->colormap[x].alpha=OpaqueAlpha; + if (ping_trans_alpha != (png_bytep) NULL) + image->colormap[x].alpha=ScaleCharToQuantum( + (unsigned char) ping_trans_alpha[x]); } } diff --git a/coders/ps.c b/coders/ps.c index 3c18e5a92..5fa8f8caf 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -1337,7 +1337,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, char buffer[MagickPathExtent], - date[MagickPathExtent], + date[MagickTimeExtent], **labels, page_geometry[MagickPathExtent]; @@ -1516,7 +1516,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, image->filename); (void) WriteBlobString(image,buffer); timer=GetMagickTime(); - (void) FormatMagickTime(timer,MagickPathExtent,date); + (void) FormatMagickTime(timer,sizeof(date),date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: (%s)\n",date); (void) WriteBlobString(image,buffer); diff --git a/coders/ps2.c b/coders/ps2.c index 31e7f75c7..de66ca739 100644 --- a/coders/ps2.c +++ b/coders/ps2.c @@ -375,7 +375,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, char buffer[MagickPathExtent], - date[MagickPathExtent], + date[MagickTimeExtent], page_geometry[MagickPathExtent], **labels; @@ -566,7 +566,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, image->filename); (void) WriteBlobString(image,buffer); timer=GetMagickTime(); - (void) FormatMagickTime(timer,MagickPathExtent,date); + (void) FormatMagickTime(timer,sizeof(date),date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: (%s)\n",date); (void) WriteBlobString(image,buffer); diff --git a/coders/ps3.c b/coders/ps3.c index 62f47c439..983862413 100644 --- a/coders/ps3.c +++ b/coders/ps3.c @@ -813,7 +813,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image, char buffer[MagickPathExtent], - date[MagickPathExtent], + date[MagickTimeExtent], **labels, page_geometry[MagickPathExtent]; @@ -1016,7 +1016,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image, image->filename); (void) WriteBlobString(image,buffer); timer=GetMagickTime(); - (void) FormatMagickTime(timer,MagickPathExtent,date); + (void) FormatMagickTime(timer,sizeof(date),date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: %s\n",date); (void) WriteBlobString(image,buffer); diff --git a/coders/svg.c b/coders/svg.c index b6e0c71bc..107236583 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -344,8 +344,9 @@ static Image *RenderSVGImage(const ImageInfo *image_info,Image *image, for (next=GetFirstImageInList(svg_image); next != (Image *) NULL; ) { (void) CopyMagickString(next->filename,image->filename, - MaxTextExtent); - (void) CopyMagickString(next->magick,image->magick,MaxTextExtent); + MagickPathExtent); + (void) CopyMagickString(next->magick,image->magick, + MagickPathExtent); next=GetNextImageInList(next); } return(svg_image); @@ -634,8 +635,8 @@ static Image *RenderRSVGImage(const ImageInfo *image_info,Image *image, (void) CloseBlob(image); for (next=GetFirstImageInList(image); next != (Image *) NULL; ) { - (void) CopyMagickString(next->filename,image->filename,MaxTextExtent); - (void) CopyMagickString(next->magick,image->magick,MaxTextExtent); + (void) CopyMagickString(next->filename,image->filename,MagickPathExtent); + (void) CopyMagickString(next->magick,image->magick,MagickPathExtent); next=GetNextImageInList(next); } return(GetFirstImageInList(image)); @@ -3694,8 +3695,8 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) } for (next=GetFirstImageInList(image); next != (Image *) NULL; ) { - (void) CopyMagickString(next->filename,image->filename,MaxTextExtent); - (void) CopyMagickString(next->magick,"SVG",MaxTextExtent); + (void) CopyMagickString(next->filename,image->filename,MagickPathExtent); + (void) CopyMagickString(next->magick,"SVG",MagickPathExtent); next=GetNextImageInList(next); } svg_info=DestroySVGInfo(svg_info); diff --git a/coders/tiff.c b/coders/tiff.c index d596efc0b..b778aa18e 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -588,7 +588,7 @@ static void TIFFErrors(const char *module,const char *format,va_list error) #else (void) vsprintf(message,format,error); #endif - message[MaxTextExtent-2]='\0'; + message[MagickPathExtent-2]='\0'; (void) ConcatenateMagickString(message,".",MagickPathExtent); exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception); if (exception != (ExceptionInfo *) NULL) @@ -953,7 +953,7 @@ static void TIFFWarnings(const char *module,const char *format,va_list warning) #else (void) vsprintf(message,format,warning); #endif - message[MaxTextExtent-2]='\0'; + message[MagickPathExtent-2]='\0'; (void) ConcatenateMagickString(message,".",MagickPathExtent); exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception); if (exception != (ExceptionInfo *) NULL) @@ -3285,7 +3285,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, MagickBooleanType adjoin, - debug, preserve_compression, status; @@ -3368,8 +3367,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, } (void) DeleteImageProfile(image,"tiff:37724"); scene=0; - debug=IsEventLogging(); - (void) debug; adjoin=image_info->adjoin; imageListLength=GetImageListLength(image); option=GetImageOption(image_info,"tiff:preserve-compression"); @@ -3379,7 +3376,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, /* Initialize TIFF fields. */ - (void) IsImageMonochrome(image); if ((image_info->type != UndefinedType) && (image_info->type != OptimizeType)) (void) SetImageType(image,image_info->type,exception); diff --git a/coders/url.c b/coders/url.c index 7e663584a..fe0297695 100644 --- a/coders/url.c +++ b/coders/url.c @@ -130,8 +130,6 @@ static void GetFTPData(void *userdata,const char *data,int size) static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) { -#define MaxBufferExtent 8192 - char filename[MagickPathExtent]; @@ -241,7 +239,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) if (LocaleCompare(read_info->magick,"http") == 0) { char - buffer[MaxBufferExtent], + buffer[8192], *type; int @@ -258,7 +256,7 @@ static Image *ReadURLImage(const ImageInfo *image_info,ExceptionInfo *exception) ssize_t count; - while ((bytes=xmlNanoHTTPRead(context,buffer,MaxBufferExtent)) > 0) + while ((bytes=xmlNanoHTTPRead(context,buffer,sizeof(buffer))) > 0) count=(ssize_t) fwrite(buffer,bytes,1,file); (void) count; xmlNanoHTTPClose(context); diff --git a/coders/yaml.c b/coders/yaml.c index b637ff043..d68cfc025 100644 --- a/coders/yaml.c +++ b/coders/yaml.c @@ -996,7 +996,7 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, if (LocaleCompare(image->magick_filename,image->filename) != 0) { char - filename[MaxTextExtent]; + filename[MagickPathExtent]; GetPathComponent(image->magick_filename,TailPath,filename); YAMLFormatLocaleFile(file," baseName: %s\n",filename); diff --git a/configure b/configure index 163bf8a10..0b010f580 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.11-6. +# Generated by GNU Autoconf 2.69 for ImageMagick 7.0.11-7. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ImageMagick' PACKAGE_TARNAME='ImageMagick' -PACKAGE_VERSION='7.0.11-6' -PACKAGE_STRING='ImageMagick 7.0.11-6' +PACKAGE_VERSION='7.0.11-7' +PACKAGE_STRING='ImageMagick 7.0.11-7' PACKAGE_BUGREPORT='https://github.com/ImageMagick/ImageMagick/issues' PACKAGE_URL='https://imagemagick.org' @@ -1845,7 +1845,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ImageMagick 7.0.11-6 to adapt to many kinds of systems. +\`configure' configures ImageMagick 7.0.11-7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1920,7 +1920,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ImageMagick 7.0.11-6:";; + short | recursive ) echo "Configuration of ImageMagick 7.0.11-7:";; esac cat <<\_ACEOF @@ -2216,7 +2216,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ImageMagick configure 7.0.11-6 +ImageMagick configure 7.0.11-7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3267,7 +3267,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ImageMagick $as_me 7.0.11-6, which was +It was created by ImageMagick $as_me 7.0.11-7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4255,7 +4255,7 @@ fi # Define the identity of the package. PACKAGE='ImageMagick' - VERSION='7.0.11-6' + VERSION='7.0.11-7' # Some tools Automake needs. @@ -4548,11 +4548,11 @@ MAGICK_MINOR_VERSION=0 MAGICK_MICRO_VERSION=11 -MAGICK_PATCHLEVEL_VERSION=6 +MAGICK_PATCHLEVEL_VERSION=7 -MAGICK_VERSION=7.0.11-6 +MAGICK_VERSION=7.0.11-7 -MAGICK_GIT_REVISION=18571:309fcfa1c:20210328 +MAGICK_GIT_REVISION=18589:0dcddb411:20210403 # Substitute library versioning @@ -4574,15 +4574,15 @@ MAGICKPP_LIBRARY_VERSION_INFO=$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISI PACKAGE_BASE_VERSION=7.0.11 -PACKAGE_PATCHLEVEL_VERSION=6 +PACKAGE_PATCHLEVEL_VERSION=7 -PACKAGE_VERSION_ADDENDUM=-6 +PACKAGE_VERSION_ADDENDUM=-7 PACKAGE_LIB_VERSION=0x70B -PACKAGE_LIB_VERSION_NUMBER=7,0,11,6 +PACKAGE_LIB_VERSION_NUMBER=7,0,11,7 -PACKAGE_RELEASE_DATE=2021-03-28 +PACKAGE_RELEASE_DATE=2021-04-03 # Ensure that make can run correctly @@ -36944,7 +36944,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ImageMagick $as_me 7.0.11-6, which was +This file was extended by ImageMagick $as_me 7.0.11-7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -37011,7 +37011,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ImageMagick config.status 7.0.11-6 +ImageMagick config.status 7.0.11-7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/m4/version.m4 b/m4/version.m4 index b0e24e32e..cc64c7dc0 100644 --- a/m4/version.m4 +++ b/m4/version.m4 @@ -27,7 +27,7 @@ m4_define([magick_name], [ImageMagick]) m4_define([magick_major_version], [7]) m4_define([magick_minor_version], [0]) m4_define([magick_micro_version], [11]) -m4_define([magick_patchlevel_version], [6]) +m4_define([magick_patchlevel_version], [7]) m4_define([magick_bugreport], [https://github.com/ImageMagick/ImageMagick/issues]) m4_define([magick_url], [https://imagemagick.org])