From bcdaeca57877ba1d8c3cc7659708e4ef6f396a0b Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 1 May 2019 16:34:58 +0100 Subject: [PATCH] fix anim webp load for some sizes rounding on resize for each frame needs to match resize for whole image --- libvips/foreign/webp2vips.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libvips/foreign/webp2vips.c b/libvips/foreign/webp2vips.c index 8a2a9146..cbe999ca 100644 --- a/libvips/foreign/webp2vips.c +++ b/libvips/foreign/webp2vips.c @@ -637,12 +637,14 @@ read_next_frame( Read *read ) printf( "read_next_frame:\n" ); #endif /*DEBUG*/ - /* Area of this frame, in output image coordinates. + /* Area of this frame, in output image coordinates. We must rint(), + * since we need the same rules as the overall image scale, or we'll + * sometimes have missing pixels on edges. */ - area.left = read->iter.x_offset * read->scale; - area.top = read->iter.y_offset * read->scale; - area.width = read->iter.width * read->scale; - area.height = read->iter.height * read->scale; + area.left = VIPS_RINT( read->iter.x_offset * read->scale ); + area.top = VIPS_RINT( read->iter.y_offset * read->scale ); + area.width = VIPS_RINT( read->iter.width * read->scale ); + area.height = VIPS_RINT( read->iter.height * read->scale ); /* Dispose from the previous frame. */