]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=29137
authorCristy <urban-warrior@imagemagick.org>
Fri, 12 Feb 2016 12:18:33 +0000 (07:18 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 12 Feb 2016 12:18:33 +0000 (07:18 -0500)
coders/caption.c

index 031e86c659ec46d84c154cc1baa6d69d494b9099..f8f26fc0c86dd1f13556a6811e537b373d78de85 100644 (file)
@@ -272,9 +272,9 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
   */
   i=FormatMagickCaption(image,draw_info,split,&metrics,&caption,exception);
   (void) CloneString(&draw_info->text,caption);
-  (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",MagickMax(
     draw_info->direction == RightToLeftDirection ? image->columns-
-    metrics.bounds.x2 : -metrics.bounds.x1,draw_info->gravity ==
+    metrics.bounds.x2 : -metrics.bounds.x1,0.0),draw_info->gravity ==
     UndefinedGravity ? metrics.ascent : 0.0);
   draw_info->geometry=AcquireString(geometry);
   status=AnnotateImage(image,draw_info,exception);