From 549259c9884d1e2a7d66e09cb25459bca9b924e3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 19 Jan 2019 12:27:50 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1457 --- ChangeLog | 5 +++++ MagickCore/annotate.c | 14 ++++++++------ coders/ttf.c | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 154f54277..3f00b687e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-01-19 7.0.8-25 Cristy + * Eliminate spurious font warning (reference + https://github.com/ImageMagick/ImageMagick/issues/1458). + * Support HEIC EXIF & XMP profiles. + 2019-01-12 7.0.8-24 Cristy * Release ImageMagick version 7.0.8-24, GIT revision 15233:db129ba64:20190112 diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index e9c705118..ee980d874 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -944,14 +944,16 @@ static MagickBooleanType RenderType(Image *image,const DrawInfo *draw_info, return(RenderX11(image,draw_info,offset,metrics,exception)); if (*draw_info->font == '^') return(RenderPostscript(image,draw_info,offset,metrics,exception)); + if (IsPathAccessible(draw_info->font) != MagickFalse) + { + status=RenderFreetype(image,draw_info,draw_info->encoding,offset, + metrics,exception); + return(status); + } type_info=GetTypeInfo(draw_info->font,exception); if (type_info == (const TypeInfo *) NULL) - if (IsPathAccessible(draw_info->font) != MagickFalse) - { - status=RenderFreetype(image,draw_info,draw_info->encoding,offset, - metrics,exception); - return(status); - } + (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning, + "UnableToReadFont","`%s'",draw_info->font); } if ((type_info == (const TypeInfo *) NULL) && (draw_info->family != (const char *) NULL)) diff --git a/coders/ttf.c b/coders/ttf.c index 92aeff8b7..57779a844 100644 --- a/coders/ttf.c +++ b/coders/ttf.c @@ -51,6 +51,7 @@ #include "MagickCore/magick.h" #include "MagickCore/memory_.h" #include "MagickCore/quantum-private.h" +#include "MagickCore/resource_.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/module.h" @@ -252,7 +253,8 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception) */ y=20; draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL); - draw_info->font=AcquireString(image->filename); + draw_info->font=AcquireString(""); + (void) ImageToFile(image,draw_info->font,exception); ConcatenateString(&draw_info->primitive,"push graphic-context\n"); (void) FormatLocaleString(buffer,MagickPathExtent, " viewbox 0 0 %.20g %.20g\n",(double) image->columns,(double) image->rows); @@ -288,6 +290,7 @@ static Image *ReadTTFImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Relinquish resources. */ + (void) RelinquishUniqueFileResource(draw_info->font); draw_info=DestroyDrawInfo(draw_info); (void) CloseBlob(image); return(GetFirstImageInList(image)); -- 2.40.0