fix a problem with shrinkv tail processing

Tail processing in shrinkv had an implicit assumption of round-down, but of
course we round to nearest. Thanks angelmixu.

see https://github.com/libvips/libvips/issues/1396
This commit is contained in:
John Cupitt 2019-08-13 11:21:01 +01:00
parent aafc2c7948
commit d80ce4bf15
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@
- fix build with GM
- add locks for pdfium load
- fix build with MSVC
- fix a problem with shinkv tail processing [angelmixu]
24/5/19 started 8.8.1
- improve realpath() use on older libc

View File

@ -329,12 +329,12 @@ vips_shrinkv_gen( VipsRegion *or, void *vseq,
r->top + r->height >= or->im->Ysize ) {
/* First unused scanline. resample->in->Ysize because we want
* the height before the embed.
*
* Because we round to nearest, unused can be negative.
*/
int first = or->im->Ysize * shrink->vshrink;
int unused = resample->in->Ysize - first;
g_assert( unused >= 0 );
for( y = 0; y < unused; y++ ) {
VipsRect s;