From d27dfbe55d9ea571ce5bf3fd4948d3804e3ebacc Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 10 Aug 2022 12:50:53 +0100 Subject: [PATCH] revise help text for loaders Hopefully to make it clearer and more consistent. See https://github.com/libvips/libvips/discussions/2982 --- libvips/foreign/heifload.c | 4 ++-- libvips/foreign/magick6load.c | 19 ++++++++++--------- libvips/foreign/magick7load.c | 7 ++++--- libvips/foreign/nsgifload.c | 4 ++-- libvips/foreign/pdfiumload.c | 12 ++++++------ libvips/foreign/popplerload.c | 12 ++++++------ libvips/foreign/tiffload.c | 6 +++--- libvips/foreign/webpload.c | 9 +++------ 8 files changed, 36 insertions(+), 37 deletions(-) diff --git a/libvips/foreign/heifload.c b/libvips/foreign/heifload.c index 40f619b2..0cf58a0e 100644 --- a/libvips/foreign/heifload.c +++ b/libvips/foreign/heifload.c @@ -1065,14 +1065,14 @@ vips_foreign_load_heif_class_init( VipsForeignLoadHeifClass *class ) VIPS_ARG_INT( class, "page", 2, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadHeif, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 3, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadHeif, n ), -1, 100000, 1 ); diff --git a/libvips/foreign/magick6load.c b/libvips/foreign/magick6load.c index 7ce6fac4..d8552ec8 100644 --- a/libvips/foreign/magick6load.c +++ b/libvips/foreign/magick6load.c @@ -130,13 +130,6 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) vips_foreign_load_magick_get_flags_filename; load_class->get_flags = vips_foreign_load_magick_get_flags; - VIPS_ARG_BOOL( class, "all_frames", 20, - _( "All frames" ), - _( "Read all frames from an image" ), - VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, - G_STRUCT_OFFSET( VipsForeignLoadMagick, all_frames ), - FALSE ); - VIPS_ARG_STRING( class, "density", 21, _( "Density" ), _( "Canvas resolution for rendering vector formats like SVG" ), @@ -146,17 +139,25 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) VIPS_ARG_INT( class, "page", 22, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadMagick, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 23, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadMagick, n ), -1, 100000, 1 ); + + VIPS_ARG_BOOL( class, "all_frames", 20, + _( "All frames" ), + _( "Read all frames from an image" ), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, + G_STRUCT_OFFSET( VipsForeignLoadMagick, all_frames ), + FALSE ); + } static void diff --git a/libvips/foreign/magick7load.c b/libvips/foreign/magick7load.c index 2e50abee..aeed86b7 100644 --- a/libvips/foreign/magick7load.c +++ b/libvips/foreign/magick7load.c @@ -380,14 +380,14 @@ vips_foreign_load_magick7_class_init( VipsForeignLoadMagick7Class *class ) VIPS_ARG_INT( class, "page", 21, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadMagick7, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 22, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadMagick7, n ), -1, 100000, 1 ); @@ -868,7 +868,8 @@ G_DEFINE_TYPE( VipsForeignLoadMagick7Buffer, vips_foreign_load_magick7_buffer, static gboolean vips_foreign_load_magick7_buffer_is_a_buffer( const void *buf, size_t len ) { - return( len > 10 && magick_ismagick( (const unsigned char *) buf, len ) ); + return( len > 10 && + magick_ismagick( (const unsigned char *) buf, len ) ); } static int diff --git a/libvips/foreign/nsgifload.c b/libvips/foreign/nsgifload.c index 499211b1..dc915af1 100644 --- a/libvips/foreign/nsgifload.c +++ b/libvips/foreign/nsgifload.c @@ -542,14 +542,14 @@ vips_foreign_load_nsgif_class_init( VipsForeignLoadNsgifClass *class ) VIPS_ARG_INT( class, "page", 10, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadNsgif, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 6, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadNsgif, n ), -1, 100000, 1 ); diff --git a/libvips/foreign/pdfiumload.c b/libvips/foreign/pdfiumload.c index 743f603a..1c195434 100644 --- a/libvips/foreign/pdfiumload.c +++ b/libvips/foreign/pdfiumload.c @@ -689,42 +689,42 @@ vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class ) VIPS_ARG_INT( class, "page", 10, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, page_no ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 11, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, n ), -1, 100000, 1 ); VIPS_ARG_DOUBLE( class, "dpi", 12, _( "DPI" ), - _( "Render at this DPI" ), + _( "DPI to render at" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, dpi ), 0.001, 100000.0, 72.0 ); VIPS_ARG_DOUBLE( class, "scale", 13, _( "Scale" ), - _( "Scale output by this factor" ), + _( "Factor to scale by" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, scale ), 0.001, 100000.0, 1.0 ); VIPS_ARG_BOXED( class, "background", 14, _( "Background" ), - _( "Background value" ), + _( "Background colour" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, background ), VIPS_TYPE_ARRAY_DOUBLE ); VIPS_ARG_STRING( class, "password", 25, _( "Password" ), - _( "Decrypt with this password" ), + _( "Password to decrypt with" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, password ), NULL ); diff --git a/libvips/foreign/popplerload.c b/libvips/foreign/popplerload.c index 5736169b..0d0d7fe8 100644 --- a/libvips/foreign/popplerload.c +++ b/libvips/foreign/popplerload.c @@ -542,42 +542,42 @@ vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class ) VIPS_ARG_INT( class, "page", 20, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, page_no ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 21, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, n ), -1, 100000, 1 ); VIPS_ARG_DOUBLE( class, "dpi", 22, _( "DPI" ), - _( "Render at this DPI" ), + _( "DPI to render at" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, dpi ), 0.001, 100000.0, 72.0 ); VIPS_ARG_DOUBLE( class, "scale", 23, _( "Scale" ), - _( "Scale output by this factor" ), + _( "Factor to scale by" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, scale ), 0.001, 100000.0, 1.0 ); VIPS_ARG_BOXED( class, "background", 24, _( "Background" ), - _( "Background value" ), + _( "Background colour" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, background ), VIPS_TYPE_ARRAY_DOUBLE ); VIPS_ARG_STRING( class, "password", 25, _( "Password" ), - _( "Decrypt with this password" ), + _( "Password to decrypt with" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadPdf, password ), NULL ); diff --git a/libvips/foreign/tiffload.c b/libvips/foreign/tiffload.c index 656fd5b6..33f0e2c3 100644 --- a/libvips/foreign/tiffload.c +++ b/libvips/foreign/tiffload.c @@ -191,14 +191,14 @@ vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) VIPS_ARG_INT( class, "page", 20, _( "Page" ), - _( "Load this page from the image" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadTiff, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 21, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadTiff, n ), -1, 100000, 1 ); @@ -212,7 +212,7 @@ vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) VIPS_ARG_INT( class, "subifd", 21, _( "subifd" ), - _( "Select subifd index" ), + _( "Subifd index" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadTiff, subifd ), -1, 100000, -1 ); diff --git a/libvips/foreign/webpload.c b/libvips/foreign/webpload.c index c3fc5fde..5b8cb74b 100644 --- a/libvips/foreign/webpload.c +++ b/libvips/foreign/webpload.c @@ -178,28 +178,25 @@ vips_foreign_load_webp_class_init( VipsForeignLoadWebpClass *class ) VIPS_ARG_INT( class, "page", 20, _( "Page" ), - _( "Load this page from the file" ), + _( "First page to load" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadWebp, page ), 0, 100000, 0 ); VIPS_ARG_INT( class, "n", 21, _( "n" ), - _( "Load this many pages" ), + _( "Number of pages to load, -1 for all" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadWebp, n ), -1, 100000, 1 ); VIPS_ARG_DOUBLE( class, "scale", 22, _( "Scale" ), - _( "Scale factor on load" ), + _( "Factor to scale by" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadWebp, scale ), 0.0, 1024.0, 1.0 ); - /* Old and deprecated scaling API. A float param lets do - * shrink-on-load for thumbnail faster and more accurately. - */ VIPS_ARG_INT( class, "shrink", 23, _( "Shrink" ), _( "Shrink factor on load" ),