revise flags for vipsthumbnail

The --rotate flag no longer did anything, so add a new --no-rotate flag
connected to the new no-rotate property. --rotate is still there, but
hidden and does nothing.

-o was much easier to remember than -f, so flip back to -o. -f still
works, but is a hidden synonym.

--iprofile, --eprofile were hard to remember. Add --import-profile and
--export-profile synonyms. iprofile / eprofile are still there and still
work, but are hidden.
This commit is contained in:
John Cupitt 2020-02-03 14:49:21 +00:00
parent 05a45c3418
commit 559ae542ac
2 changed files with 32 additions and 15 deletions

View File

@ -6,6 +6,7 @@
- tiffsave has a "depth" param to set max pyr depth
- libtiff LOGLUV images load and save as libvips XYZ
- add gifload_source
- revise vipsthumbnail flags
31/1/19 started 8.9.2
- fix a deadlock with --vips-leak [DarthSim]

View File

@ -96,6 +96,10 @@
* - add --intent
* 23/10/17
* - --size Nx didn't work, argh ... thanks jrochkind
* 3/2/20
* - add --no-rotate
* - add --import-profile / --export-profile names
* - back to -o for output
*/
#ifdef HAVE_CONFIG_H
@ -127,8 +131,8 @@ static char *import_profile = NULL;
static gboolean delete_profile = FALSE;
static gboolean linear_processing = FALSE;
static gboolean crop_image = FALSE;
static gboolean no_rotate_image = FALSE;
static char *smartcrop_image = NULL;
static gboolean rotate_image = FALSE;
static char *thumbnail_intent = NULL;
/* Deprecated and unused.
@ -138,25 +142,22 @@ static gboolean nodelete_profile = FALSE;
static gboolean verbose = FALSE;
static char *convolution_mask = NULL;
static char *interpolator = NULL;
static gboolean rotate_image = FALSE;
static GOptionEntry options[] = {
{ "size", 's', 0,
G_OPTION_ARG_STRING, &thumbnail_size,
N_( "shrink to SIZE or to WIDTHxHEIGHT" ),
N_( "SIZE" ) },
{ "output", 'o', G_OPTION_FLAG_HIDDEN,
{ "output", 'o', 0,
G_OPTION_ARG_STRING, &output_format,
N_( "set output to FORMAT" ),
N_( "output to FORMAT" ),
N_( "FORMAT" ) },
{ "format", 'f', 0,
G_OPTION_ARG_STRING, &output_format,
N_( "set output format string to FORMAT" ),
N_( "FORMAT" ) },
{ "eprofile", 'e', 0,
{ "export-profile", 'e', 0,
G_OPTION_ARG_FILENAME, &export_profile,
N_( "export with PROFILE" ),
N_( "PROFILE" ) },
{ "iprofile", 'i', 0,
{ "import-profile", 'i', 0,
G_OPTION_ARG_FILENAME, &import_profile,
N_( "import untagged images with PROFILE" ),
N_( "PROFILE" ) },
@ -171,13 +172,28 @@ static GOptionEntry options[] = {
G_OPTION_ARG_STRING, &thumbnail_intent,
N_( "ICC transform with INTENT" ),
N_( "INTENT" ) },
{ "rotate", 't', 0,
G_OPTION_ARG_NONE, &rotate_image,
N_( "auto-rotate" ), NULL },
{ "delete", 'd', 0,
G_OPTION_ARG_NONE, &delete_profile,
N_( "delete profile from exported image" ), NULL },
{ "no-rotate", 0, 0,
G_OPTION_ARG_NONE, &no_rotate_image,
N_( "don't auto-rotate" ), NULL },
{ "format", 'f', G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_STRING, &output_format,
N_( "set output format string to FORMAT" ),
N_( "FORMAT" ) },
{ "eprofile", 0, G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_FILENAME, &export_profile,
N_( "export with PROFILE" ),
N_( "PROFILE" ) },
{ "iprofile", 0, G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_FILENAME, &import_profile,
N_( "import untagged images with PROFILE" ),
N_( "PROFILE" ) },
{ "rotate", 't', G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_NONE, &rotate_image,
N_( "(deprecated, does nothing)" ), NULL },
{ "crop", 'c', G_OPTION_FLAG_HIDDEN,
G_OPTION_ARG_NONE, &crop_image,
N_( "(deprecated, crop exactly to SIZE)" ), NULL },
@ -280,11 +296,11 @@ thumbnail_process( VipsObject *process, const char *filename )
if( vips_thumbnail( filename, &image, thumbnail_width,
"height", thumbnail_height,
"size", size_restriction,
"auto_rotate", rotate_image,
"no-rotate", no_rotate_image,
"crop", interesting,
"linear", linear_processing,
"import_profile", import_profile,
"export_profile", export_profile,
"import-profile", import_profile,
"export-profile", export_profile,
"intent", intent,
NULL ) )
return( -1 );