From e9707bcafdb7abc12e02cd06485a1e7f78c4af41 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 14 Apr 2015 13:18:37 +0100 Subject: [PATCH] better cache trace --- libvips/iofuncs/object.c | 9 ++++----- libvips/iofuncs/operation.c | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c index 33e4a131..7e109bdd 100644 --- a/libvips/iofuncs/object.c +++ b/libvips/iofuncs/object.c @@ -1849,9 +1849,9 @@ vips_object_set_argument_from_string( VipsObject *object, else access = VIPS_ACCESS_RANDOM; - if( vips_foreign_load( value, &out, + if( !(out = vips_image_new_from_file( value, "access", access, - NULL ) ) + NULL )) ) return( -1 ); g_value_init( &gvalue, VIPS_TYPE_IMAGE ); @@ -2073,11 +2073,10 @@ vips_object_get_argument_to_string( VipsObject *object, if( g_type_is_a( otype, VIPS_TYPE_IMAGE ) ) { VipsImage *in; - - /* Pull out the image and write it. +/* Pull out the image and write it. */ g_object_get( object, name, &in, NULL ); - if( vips_foreign_save( in, arg, NULL ) ) { + if( vips_image_write_to_file( in, arg, NULL ) ) { g_object_unref( in ); return( -1 ); } diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c index 2b3c41bc..b122faf5 100644 --- a/libvips/iofuncs/operation.c +++ b/libvips/iofuncs/operation.c @@ -1358,6 +1358,13 @@ vips_call_argv( VipsOperation *operation, int argc, char **argv ) if( vips_object_build( VIPS_OBJECT( operation ) ) ) return( -1 ); + /* We're not using the cache, so we need to print the trace line. + */ + if( vips__cache_trace ) { + printf( "vips cache : " ); + vips_object_print_summary( VIPS_OBJECT( operation ) ); + } + call.i = 0; if( vips_argument_map( VIPS_OBJECT( operation ), vips_call_argv_output, &call, NULL ) )