doesn't seem to slow us down significantly ... before:

$ time vips dzsave CMU-1.svs x --layout google --background "243 243 243 255"
real	1m1.940s
user	2m15.004s
sys	0m37.092s

after:

$ time vips dzsave CMU-1.svs x --layout google --background "243 243 243 255"
strip_work: skipping blank tile 176 x 67
strip_work: skipping blank tile 21 x 112
real	1m3.503s
user	2m16.012s
sys	0m40.328s
This commit is contained in:
John Cupitt 2015-11-24 17:08:56 +00:00
parent bf65adc92b
commit e19f9ea0b3
2 changed files with 16 additions and 11 deletions

View File

@ -14,6 +14,7 @@
- added vips_mapim() ... resample with an index image, plus test
- try to improve vips_resize() quality a little more
- vips_resize() can do non-square resizes
- dzsave won't write empty tiles in google mode
7/5/15 started 8.1.1
- oop, vips-8.0 wrapper script should be vips-8.1, thanks Danilo

View File

@ -55,6 +55,8 @@
* - allow zip > 4gb if we have a recent libgsf
* 9/9/15
* - better overlap handling, thanks robclouth
* 24/11/15
* - don't write empty tiles in google mode
*/
/*
@ -1179,11 +1181,13 @@ strip_work( VipsThreadState *state, void *a )
*/
if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE &&
tile_equal( x, dz->ink ) ) {
g_object_unref( x );
#ifdef DEBUG_VERBOSE
#endif /*DEBUG_VERBOSE*/
printf( "strip_work: skipping blank tile %d x %d\n",
state->x / dz->tile_size,
state->y / dz->tile_size );
#endif /*DEBUG_VERBOSE*/
return( 0 );
}
@ -1589,16 +1593,6 @@ vips_foreign_save_dz_build( VipsObject *object )
vips_area_unref( VIPS_AREA( background ) );
}
/* We use ink in google mode to check for blank tiles.
*/
if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE ) {
if( !(dz->ink = vips__vector_to_ink(
class->nickname, save->ready,
VIPS_AREA( save->background )->data, NULL,
VIPS_AREA( save->background )->n )) )
return( -1 );
}
if( dz->overlap >= dz->tile_size ) {
vips_error( "dzsave",
"%s", _( "overlap must be less than tile "
@ -1633,6 +1627,16 @@ vips_foreign_save_dz_build( VipsObject *object )
save->ready = z;
}
/* We use ink in google mode to check for blank tiles.
*/
if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE ) {
if( !(dz->ink = vips__vector_to_ink(
class->nickname, save->ready,
VIPS_AREA( save->background )->data, NULL,
VIPS_AREA( save->background )->n )) )
return( -1 );
}
/* How much we step by as we write tiles.
*/
dz->tile_step = dz->tile_size - dz->overlap;