]> granicus.if.org Git - imagemagick/commitdiff
Fix text wrapping bug
authorArthur Darcet <arthur.darcet@m4x.org>
Tue, 30 Aug 2016 13:23:32 +0000 (15:23 +0200)
committerArthur Darcet <arthur.darcet@m4x.org>
Tue, 30 Aug 2016 13:23:32 +0000 (15:23 +0200)
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

MagickCore/annotate.c

index 297304f60307004bf799a7a068c37291bdb154bf..b98397417fc64c76b9e83c72cb564d2ff8889278 100644 (file)
@@ -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))