From: Arthur Darcet Date: Tue, 30 Aug 2016 13:23:32 +0000 (+0200) Subject: Fix text wrapping bug X-Git-Tag: 7.0.3-0~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f55f53e1f48dc1a5037f6295d3a6b2ee4d4a06b;p=imagemagick Fix text wrapping bug If the last letter of the last word is the only thing overflowing, but there is a wrap point somewhere available, then it should be used to wrap --- diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 297304f60..b98397417 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -634,7 +634,7 @@ MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info, if (status == MagickFalse) break; width=(size_t) floor(metrics->width+draw_info->stroke_width+0.5); - if ((width <= image->columns) || (strcmp(text,draw_info->text) == 0)) + if ((width <= image->columns) || (s == (char *) NULL)) continue; (void) strcpy(text,draw_info->text); if ((s != (char *) NULL) && (GetUTFOctets(s) == 1))