fix an obscure dzsave bug

in some cases dzsave could fail to write all the pyramid layers out

the problem was if a layer was odd-sized and needed rounding up so it
could be shrunk from, and if the tile size was such that the final strip
was sized exactly to fit the last line of pixels that would come into
this layer, the final line of pixels could never be interpolated

thanks to Martin for the report
This commit is contained in:
John Cupitt 2013-01-17 13:14:47 +00:00
parent c570bf902e
commit b2cd5f631e
1 changed files with 11 additions and 0 deletions

View File

@ -947,6 +947,17 @@ strip_arrived( Layer *layer )
new_strip.width = layer->image->Xsize;
new_strip.height = dz->tile_size + 2 * dz->overlap + 1;
/* We may exactly hit the bottom of the real image (ie. before borders
* have been possibly expanded by 1 pixel). In this case, we'll not
* be able to do the expansion in layer_generate_extras(), since the
* region won't be large enough, and we'll not get another chance
* since this is the bottom.
*
* Add another scanline if this has happened.
*/
if( VIPS_RECT_BOTTOM( &new_strip ) == layer->height )
new_strip.height = layer->image->Ysize - new_strip.top;
/* What pixels that we will need do we already have? Save them in
* overlap.
*/