From bef7e7b33aee238302bdebc5686b69c6e5e35688 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Jun 2020 11:46:02 +0200 Subject: add fix from https://github.com/ImageMagick/ImageMagick6/pull/86 --- 86.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 86.patch (limited to '86.patch') diff --git a/86.patch b/86.patch new file mode 100644 index 0000000..97b1507 --- /dev/null +++ b/86.patch @@ -0,0 +1,44 @@ +From c99f35ad120aa9f8cc95f1262b4f5ecf8ef7598a Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 24 Jun 2020 11:06:47 +0200 +Subject: [PATCH] fix #85 regression in DrawSetTextInterlineSpacing + +revert 77849ee5a5f0481e0bfd67f72f6b7e07c5d2ba46 +revert 147e71502f8f08f986c35bb1387dc0e7543dbcb7 + +also fix https://github.com/ImageMagick/ImageMagick/issues/2178 +--- + magick/annotate.c | 7 ++----- + magick/draw.c | 1 + + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/magick/annotate.c b/magick/annotate.c +index 32a08e767..89b06ba36 100644 +--- a/magick/annotate.c ++++ b/magick/annotate.c +@@ -324,11 +324,8 @@ MagickExport MagickBooleanType AnnotateImage(Image *image, + (void) CloneString(&annotate->text,textlist[i]); + if ((metrics.width == 0) || (annotate->gravity != NorthWestGravity)) + (void) GetTypeMetrics(image,annotate,&metrics); +- height=(size_t) ceil(metrics.ascent-metrics.descent+ +- draw_info->interline_spacing-0.5); +- if (height == 0) +- height=(size_t) ceil(draw_info->pointsize+draw_info->interline_spacing- +- 0.5); ++ height=(ssize_t) (metrics.ascent-metrics.descent+ ++ draw_info->interline_spacing+0.5); + switch (annotate->gravity) + { + case UndefinedGravity: +diff --git a/magick/draw.c b/magick/draw.c +index 5950d6ff2..194a9ee27 100644 +--- a/magick/draw.c ++++ b/magick/draw.c +@@ -5781,6 +5781,7 @@ MagickExport void GetDrawInfo(const ImageInfo *image_info,DrawInfo *draw_info) + draw_info->pointsize=12.0; + if (fabs(clone_info->pointsize) >= MagickEpsilon) + draw_info->pointsize=clone_info->pointsize; ++ draw_info->interline_spacing=draw_info->pointsize; + draw_info->undercolor.opacity=(Quantum) TransparentOpacity; + draw_info->border_color=clone_info->border_color; + draw_info->compose=OverCompositeOp; -- cgit