diff --git a/ChangeLog b/ChangeLog index 0a71337e..0953200c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ - im_filename_suffix() includes "." in suffix - merge back into trunk for 7.15.1 - remove im_ispng(), im_png2vips_header() etc. & friends +- add "vips --list formats" 7/3/08 started 7.15.0 - MAGIC constants should be tagged as unsigned diff --git a/TODO b/TODO index 628c4523..ebbf1d4d 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,4 @@ -- check man pages for im_isjpeg(), im_jpeg2vips_header() etc. - -- write man pages for im_format api +- needs docs in vips manual for format stuff I guess - operations and jesper's types should all use the new register/unregister model @@ -11,10 +9,20 @@ have new structs with new fields under new names? eg. jesper wants something to write to a string + though we have to pass (almost) the same structs to UIs argh and we can't + change them + + jesper wants to add another field to im_type_desc ... so, keep im_type_desc + as is and define a new struct im_type_t with the extra fields + + when we load a package, call im_type_register with the known fields + check other use cases eg. nip2, python, c++, vips.c -- add new type names, eg. im_region_t, im_image_t etc. and deprecate old - names? + reread the plugin section in the vipsmanual and think about compat + + +- junk package system? @@ -25,19 +33,6 @@ null for success, or errormsg -- something in vips.c to list the available formats, like - - vips --list packages - - perhaps - - vips --list formats - -- add API to add operations and formats, can be used by plugins in module init - to register stuff - -- deprecate the current plugin init system - - more cleanups to the handling of vips format images, esp. we have vips write spread across many files atm @@ -51,6 +46,11 @@ should im_format become im_format_t? what's the current naming convention? should be add _t variants for all types? + add new type names, eg. im_region_t, im_image_t etc. and deprecate old + names? + + sigh or maybe VipsRegion, VipsImage + - when we open with a mmap window and later do im_incheck(), do we remap the diff --git a/src/iofuncs/vips.c b/src/iofuncs/vips.c index 62bf60fa..767e76c9 100644 --- a/src/iofuncs/vips.c +++ b/src/iofuncs/vips.c @@ -24,6 +24,8 @@ * - add --list packages * 26/2/07 * - add input *VEC arg types to C++ binding + * 17/8/08 + * - add --list formats */ /* @@ -148,7 +150,7 @@ map_name( const char *name, map_name_fn fn ) static void * list_package( im_package *pack ) { - printf( "%-18s - %d operations\n", pack->name, pack->nfuncs ); + printf( "%-20s - %d operations\n", pack->name, pack->nfuncs ); return( NULL ); } @@ -156,7 +158,37 @@ list_package( im_package *pack ) static void * list_function( im_function *func ) { - printf( "%-18s - %s\n", func->name, _( func->desc ) ); + printf( "%-20s - %s\n", func->name, _( func->desc ) ); + + return( NULL ); +} + +static void * +list_format( im_format_t *format ) +{ + const char **p; + + printf( "%-20s - ", format->name_user ); + + printf( "(" ); + for( p = format->suffs; *p; p++ ) { + printf( "%s", *p ); + if( p[1] ) + printf( ", " ); + } + printf( ") " ); + + if( format->is_a ) + printf( "is_a " ); + if( format->header ) + printf( "header " ); + if( format->load ) + printf( "load " ); + if( format->save ) + printf( "save " ); + if( format->flags ) + printf( "flags " ); + printf( "\n" ); return( NULL ); } @@ -166,6 +198,8 @@ print_list( const char *name ) { if( strcmp( name, "packages" ) == 0 ) im_map_packages( (VSListMap2Fn) list_package, NULL ); + else if( strcmp( name, "formats" ) == 0 ) + im_format_map( (VSListMap2Fn) list_format, NULL, NULL ); else { if( map_name( name, list_function ) ) error_exit( "unknown package \"%s\"", name );