From: Cristy Date: Sun, 19 Jun 2016 14:01:37 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/222 X-Git-Tag: 7.0.2-1~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e1dd685b642e235234931b24d11045041254eaf;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/222 --- diff --git a/ChangeLog b/ChangeLog index 565223191..ca015776a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ 2016-06-12 7.0.2-1 Cristy * Distort no longer converts grayscale image to sRGB (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=29895). + * Don't return a zero bounding box for QueryMultilineFontMetrics() (reference + https://github.com/ImageMagick/ImageMagick/issues/222). 2016-06-12 7.0.2-0 Cristy * Release ImageMagick version 7.0.2-0, GIT revision 10884:f0e15e8:20160612. diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 9d56905d8..583dd90ec 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1533,13 +1533,17 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, if (ft_status != 0) continue; if ((p == draw_info->text) || (bounds.xMin < metrics->bounds.x1)) - metrics->bounds.x1=(double) bounds.xMin; + if (bounds.xMin != 0) + metrics->bounds.x1=(double) bounds.xMin; if ((p == draw_info->text) || (bounds.yMin < metrics->bounds.y1)) - metrics->bounds.y1=(double) bounds.yMin; + if (bounds.yMin != 0) + metrics->bounds.y1=(double) bounds.yMin; if ((p == draw_info->text) || (bounds.xMax > metrics->bounds.x2)) - metrics->bounds.x2=(double) bounds.xMax; + if (bounds.xMax != 0) + metrics->bounds.x2=(double) bounds.xMax; if ((p == draw_info->text) || (bounds.yMax > metrics->bounds.y2)) - metrics->bounds.y2=(double) bounds.yMax; + if (bounds.yMax != 0) + metrics->bounds.y2=(double) bounds.yMax; if (((draw_info->stroke.alpha != TransparentAlpha) || (draw_info->stroke_pattern != (Image *) NULL)) && ((status != MagickFalse) && (draw_info->render != MagickFalse)))