From da31d0f31a031ea667e96081e6ccf558a36df9f5 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 7 Dec 2018 12:57:44 +0000 Subject: [PATCH] fix autofit loop on non-scaleable fonts see https://github.com/libvips/libvips/issues/1178 --- ChangeLog | 3 +++ configure.ac | 6 +++--- libvips/create/text.c | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 262018d4..d4ffb172 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +21/11/18 started 8.7.3 +- fix infinite loop for autofit with non-scaleable font + 21/11/18 started 8.7.2 - more info output for temp files to help diagnose problems - vips_text() could set the wrong DPI diff --git a/configure.ac b/configure.ac index 15b0e243..329a438d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # also update the version number in the m4 macros below -AC_INIT([vips], [8.7.2], [vipsip@jiscmail.ac.uk]) +AC_INIT([vips], [8.7.3], [vipsip@jiscmail.ac.uk]) # required for gobject-introspection AC_PREREQ(2.62) @@ -18,7 +18,7 @@ AC_CONFIG_MACRO_DIR([m4]) # user-visible library versioning m4_define([vips_major_version], [8]) m4_define([vips_minor_version], [7]) -m4_define([vips_micro_version], [2]) +m4_define([vips_micro_version], [3]) m4_define([vips_version], [vips_major_version.vips_minor_version.vips_micro_version]) @@ -38,7 +38,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date -u -r ChangeLog` # binary interface changes not backwards compatible?: reset age to 0 LIBRARY_CURRENT=51 -LIBRARY_REVISION=2 +LIBRARY_REVISION=3 LIBRARY_AGE=9 # patched into include/vips/version.h diff --git a/libvips/create/text.c b/libvips/create/text.c index a6a4810a..a017fe8d 100644 --- a/libvips/create/text.c +++ b/libvips/create/text.c @@ -265,6 +265,12 @@ vips_text_autofit( VipsText *text ) previous_dpi = text->dpi; text->dpi = difference < 0 ? text->dpi * 2 : text->dpi / 2; + + /* This can happen with some fonts that don't resize + * gracefully. + */ + if( text->dpi < 2 ) + break; } if( difference < 0 ) {