From 6e102f119708e9785bd26b3f9d6b9f86b0a488bc Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 9 Jun 2019 09:02:02 -0400 Subject: [PATCH] ... --- MagickCore/annotate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index d278aad41..8e7577f66 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -288,6 +288,7 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, if (IsGrayColorspace(image->colorspace) != MagickFalse) (void) SetImageColorspace(image,sRGBColorspace,exception); status=MagickTrue; + (void) memset(&metrics,0,sizeof(metrics)); for (i=0; textlist[i] != (char *) NULL; i++) { /* @@ -296,7 +297,8 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, annotate_info->affine.tx=geometry_info.xi-image->page.x; annotate_info->affine.ty=geometry_info.psi-image->page.y; (void) CloneString(&annotate->text,textlist[i]); - (void) GetTypeMetrics(image,annotate,&metrics,exception); + if ((metrics.width == 0) || (annotate->gravity != NorthWestGravity)) + (void) GetTypeMetrics(image,annotate,&metrics,exception); height=(ssize_t) (metrics.ascent-metrics.descent+ draw_info->interline_spacing+0.5); switch (annotate->gravity) -- 2.40.0