fix blocking of caching of seq load

we were setting nocache too late for the cache to see, move nocache
logic to _build()
This commit is contained in:
John Cupitt 2013-11-09 11:38:32 +00:00
parent ebae3f7ed3
commit 63c1efc3b4
3 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,7 @@
- fix compiler warnings in ubuntu 13.10
- reverse similarity rotation direction to match the convention used
elsewhere in vips
- fix blocked caching of sequential load operations
10/10/13 started 7.36.2
- better jpeg startup

View File

@ -690,10 +690,6 @@ vips_foreign_load_temp( VipsForeignLoad *load )
printf( "vips_foreign_load_temp: partial sequential temp\n" );
#endif /*DEBUG*/
/* You can't reuse sequential operations.
*/
load->nocache = TRUE;
return( vips_image_new() );
}
@ -833,6 +829,13 @@ vips_foreign_load_build( VipsObject *object )
g_object_set( load, "flags", flags, NULL );
/* If the loader can do sequential mode and sequential has been
* requested, we need to block caching.
*/
if( (load->flags & VIPS_FOREIGN_SEQUENTIAL) &&
load->access != VIPS_ACCESS_RANDOM )
load->nocache = TRUE;
if( VIPS_OBJECT_CLASS( vips_foreign_load_parent_class )->
build( object ) )
return( -1 );

View File

@ -692,7 +692,7 @@ vips_cache_operation_buildp( VipsOperation **operation )
if( (hit = g_hash_table_lookup( vips_cache_table, *operation )) ) {
if( vips__cache_trace ) {
printf( "vips cache: hit\n" );
printf( "vips cache: found old operation\n" );
printf( "\t" );
vips_object_print_summary( VIPS_OBJECT( hit ) );
}
@ -718,7 +718,7 @@ vips_cache_operation_buildp( VipsOperation **operation )
VIPS_OPERATION_NOCACHE )
printf( "vips cache: uncacheable\n" );
else
printf( "vips cache: miss\n" );
printf( "vips cache: caching new operation\n" );
printf( "\t" );
vips_object_print_summary( VIPS_OBJECT( *operation ) );
}