diff --git a/TODO b/TODO index 0dbeb6ea..17ed05e7 100644 --- a/TODO +++ b/TODO @@ -1,20 +1,10 @@ - also VipsFormat ... could this replace vips_image_new_from_string()? or could we call this from vips_image_new_from_string()? + at the moment, VipsFormat subclasses never get made, we just use the classes + ... we'd need to start making real vipsformat objects for this to work - - - - -- use this system to do file format options, eg. - - vips copy fred.v fred.jpg{quality=90} - - need to keep the old arg parser for compat - - how do we get the new one called? will each writer need to test for a ':' - char? - + how much effort would this be to change? @@ -24,6 +14,49 @@ what would the API look like? + VipsImage * + thing( VipsImage *in1, VipsImage *in2 ) + { + VipsImage *t; + VipsImage *out; + + if( vips_add( in1, in2, &t, NULL ) ) + return( NULL ); + if( vips_add( in1, t, &out, NULL ) ) { + g_object_unref( t ); + return( NULL ); + } + g_object_unref( t ); + + return( out ); + } + + yuk! how can we simplify this? keep refs in an array? + + VipsImage * + thing( VipsImage *in1, VipsImage *in2 ) + { + VipsImage *t[5] = { NULL }; + VipsImage *out; + + if( vips_add( in1, in2, &t[0], NULL ) || + vips_add( in1, t[0], &out, NULL ) ) { + vips_unref_array( t, 5 ); + return( NULL ); + } + vips_unref_array( t, 5 ); + + return( out ); + } + + vips_unref_array() just unrefs all non-NULL pointers in the array + + + + + + + - try out: diff --git a/libvips/format/format.c b/libvips/format/format.c index 22b5da6a..17639ebc 100644 --- a/libvips/format/format.c +++ b/libvips/format/format.c @@ -317,6 +317,9 @@ vips_format_class_init( VipsFormatClass *class ) VipsObjectClass *object_class = (VipsObjectClass *) class; object_class->print_class = vips_format_print_class; + + object_class->print_class = vips_format_print_class; + } static void