revise help text for loaders

Hopefully to make it clearer and more consistent.

See https://github.com/libvips/libvips/discussions/2982
This commit is contained in:
John Cupitt 2022-08-10 12:50:53 +01:00
parent 1482753c90
commit d27dfbe55d
8 changed files with 36 additions and 37 deletions

View File

@ -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 );

View File

@ -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

View File

@ -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

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );

View File

@ -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" ),