From fb23c3df7fcf7ecc0ac6696b0659c6b14608ad6a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 5 Jul 2012 18:08:55 +0100 Subject: [PATCH] improvements to dzsave it wasn't making the RH column of tiles if they were cropped makes tiles all the way down to 1x1 pixels --- libvips/foreign/dzsave.c | 21 ++++++++++----------- po/en_GB.gmo | Bin 622 -> 0 bytes 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index 33c69da4..a02e78b4 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -2,11 +2,10 @@ * * 21/3/12 * - from the tiff pyramid writer - - -- need to copy overlap down strips - - + * + * 5/7/12 + * - make tiles down to 1x1 pixels + * - oop make right-hand edge tiles */ /* @@ -165,8 +164,8 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, int w, int h ) return( NULL ); } - if( w > dz->tile_width || - h > dz->tile_height ) { + if( w > 1 && + h > 1 ) { if( !(layer->below = pyramid_build( dz, layer, w / 2, h / 2 )) ) { layer_free( layer ); @@ -344,7 +343,6 @@ strip_save( Layer *layer ) { VipsForeignSaveDz *dz = layer->dz; VipsRegion *strip = layer->strip; - int y = strip->valid.top / dz->tile_height; VipsImage *image; int x; @@ -355,13 +353,13 @@ strip_save( Layer *layer ) strip->im->Bands, strip->im->BandFmt )) ) return( -1 ); - for( x = 0; x < strip->valid.width / dz->tile_width; x++ ) { + for( x = 0; x < strip->valid.width; x += dz->tile_width ) { VipsImage *extr; VipsRect tile; char str[1000]; VipsBuf buf = VIPS_BUF_STATIC( str ); - tile.left = x * dz->tile_width; + tile.left = x; tile.top = strip->valid.top; tile.width = dz->tile_width + dz->overlap; tile.height = dz->tile_height + dz->overlap; @@ -377,7 +375,8 @@ strip_save( Layer *layer ) vips_buf_appendf( &buf, "%s/%d/%d_%d%s", dz->dirname, layer->n, - x, y, + x / dz->tile_width, + strip->valid.top / dz->tile_height, dz->suffix ); if( vips_image_write_to_file( extr, vips_buf_all( &buf ) ) ) { diff --git a/po/en_GB.gmo b/po/en_GB.gmo index 9906858d868ea3be214d6c0c48b5c0c61992c3d5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 622 zcma)(%}T^D6ou>G!dbe|jf*VQjodM)yd<*wJ zi>HbV3W66tPSTuvo16PSH~kzTrokfE0W;tRv|+&#cm&Jf1|_+J zK-ZuP&}%4;qbbnV#`Y^3t!i7zTIwJRrnGGW%S~k*^H$`N@zL@q`e`yv_`~HJYmI9Q zeU%7LRz?@jJjguINkP}rd1Z9UDs?+l)>C0}w$)9NF7I5*HkAgxR0SP0rKilKtaEXm zQQt`skVl6i$dn~KPKd7)@3ACKd9un8Fw&(Qs$8%}^H<;hH LpOeAq=V(3vaU8RW