From ec79682215511c98542ea39e961b7f9b365ad33d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 6 Jan 2017 14:01:55 +0000 Subject: [PATCH] small fixes --- man/vipsthumbnail.1 | 15 +++++++++++---- tools/vipsthumbnail.c | 5 +++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/man/vipsthumbnail.1 b/man/vipsthumbnail.1 index 595b8504..e83046b5 100644 --- a/man/vipsthumbnail.1 +++ b/man/vipsthumbnail.1 @@ -40,10 +40,16 @@ Set the output thumbnail size to .B N x .B N -pixels. You can use MxN to specify a rectangular bounding box. +pixels. + +You can use "MxN" to specify a rectangular bounding box. The image is shrunk so that it just fits within this area, images -which are smaller than this are expanded. Use "xN" or "Mx" to just resize on -one axis. Append "<" to only resize if the input image is smaller than the +which are smaller than this are expanded. + +Use "xN" or "Mx" to just resize on +one axis. + +Append "<" to only resize if the input image is smaller than the target, append ">" to only resize if the input image is larger than the target. .TP @@ -52,7 +58,8 @@ Set the output format string. The input filename has any file type suffix removed, then that value is substitued into .B FORMAT replacing -.B %s. If +.B %s. +If .B FORMAT is a relative path, the name of the input directory is prepended. In other words, any path in diff --git a/tools/vipsthumbnail.c b/tools/vipsthumbnail.c index 154bcf1b..69f53d46 100644 --- a/tools/vipsthumbnail.c +++ b/tools/vipsthumbnail.c @@ -265,7 +265,7 @@ fetch_match( GMatchInfo *match_info, int n ) { const char *str = g_match_info_fetch( match_info, n ); - return( strcmp( str, "" ) == 0 ? NULL : str ); + return( str && strcmp( str, "" ) == 0 ? NULL : str ); } /* Parse a geometry string and set thumbnail_width and thumbnail_height. @@ -392,7 +392,8 @@ main( int argc, char **argv ) g_option_context_free( context ); - if( thumbnail_parse_geometry( thumbnail_size ) ) + if( thumbnail_size && + thumbnail_parse_geometry( thumbnail_size ) ) vips_error_exit( NULL ); #ifndef HAVE_EXIF