oops matlab load compat wrapper was broken

This commit is contained in:
John Cupitt 2012-01-12 14:14:54 +00:00
parent 351a2ad71c
commit 5096031371
3 changed files with 21 additions and 20 deletions

1
TODO
View File

@ -1,4 +1,3 @@
- Vips.Image has members like chain, __subclasshook__ etc etc, are we
really subclassing it correctly?

View File

@ -42,7 +42,7 @@ im_mat2vips( const char *filename, IMAGE *out )
{
VipsImage *t;
if( vips_ppmload( filename, &t, NULL ) )
if( vips_matload( filename, &t, NULL ) )
return( -1 );
if( vips_image_write( t, out ) ) {
g_object_unref( t );

View File

@ -1041,6 +1041,26 @@ main( int argc, char **argv )
break;
}
/* Could be a vips7 im_function. We need to test for vips7 first,
* since we don't want to use the vips7 compat wrappers in vips8
* unless we have to. They don't support all args types.
*/
if( action && !handled &&
(fn = im_find_function( action )) ) {
(void) add_main_group( context, NULL );
parse_options( context, &argc, argv );
if( im_run_command( action, argc - 1, argv + 1 ) ) {
if( argc == 1 )
usage( fn );
else
error_exit( NULL );
}
handled = TRUE;
}
im_error_clear();
/* Could be a vips8 VipsOperation.
*/
if( action && !handled &&
@ -1067,24 +1087,6 @@ main( int argc, char **argv )
}
im_error_clear();
/* Could be a vips7 im_function.
*/
if( action && !handled &&
(fn = im_find_function( action )) ) {
(void) add_main_group( context, NULL );
parse_options( context, &argc, argv );
if( im_run_command( action, argc - 1, argv + 1 ) ) {
if( argc == 1 )
usage( fn );
else
error_exit( NULL );
}
handled = TRUE;
}
im_error_clear();
if( action && !handled ) {
printf( "%s", _( "possible actions:\n" ) );
for( i = 0; i < VIPS_NUMBER( actions ); i++ )