Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/4278
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Sep 26, 2021
1 parent a96f221 commit 4748ccc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions coders/caption.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ static Image *ReadCAPTIONImage(const ImageInfo *image_info,
i=FormatMagickCaption(image,draw_info,split,&metrics,&caption);
(void) CloneString(&draw_info->text,caption);
caption=DestroyString(caption);
(void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",MagickMax(
draw_info->direction == RightToLeftDirection ? (double) image->columns-
metrics.bounds.x2 : -metrics.bounds.x1,0.0),(draw_info->gravity ==
UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
(draw_info->direction == RightToLeftDirection ? (double) image->columns-
metrics.bounds.x2 : -metrics.bounds.x1),(draw_info->gravity ==
UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) :
-metrics.bounds.y1));
(void) CloneString(&draw_info->geometry,geometry);
status=AnnotateImage(image,draw_info);
if (image_info->pointsize == 0.0)
Expand Down
5 changes: 3 additions & 2 deletions coders/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
*/
(void) FormatLocaleString(geometry,MagickPathExtent,"%+g%+g",
(draw_info->direction == RightToLeftDirection ? (double) image->columns-
metrics.bounds.x2 : 0.0),(draw_info->gravity == UndefinedGravity ?
MagickMax(metrics.ascent,metrics.bounds.y2) : 0.0));
metrics.bounds.x2 : -metrics.bounds.x1),(draw_info->gravity ==
UndefinedGravity ? MagickMax(metrics.ascent,metrics.bounds.y2) :
-metrics.bounds.y1));
(void) CloneString(&draw_info->geometry,geometry);
status=AnnotateImage(image,draw_info);
if (image_info->pointsize == 0.0)
Expand Down

0 comments on commit 4748ccc

Please sign in to comment.