smoother aniamted webp write

set the timestamp for the fake final frame equal to the last actual
frame ... removes the anim hitch

we are still mysteriously dropping a frame though

see https://github.com/libvips/libvips/issues/1261
This commit is contained in:
John Cupitt 2019-04-12 17:06:42 +01:00
parent bae484ba2c
commit 6a3b197f31
1 changed files with 3 additions and 2 deletions

View File

@ -348,9 +348,10 @@ write_webp_anim( VipsWebPWrite *write, VipsImage *image, int page_height )
timestamp_ms += delay;
}
/* Add a last fake frame to signal the last duration.
/* Add a last zero length fake frame to signal the last duration.
*/
if( !WebPAnimEncoderAdd( write->enc, NULL, timestamp_ms, NULL ) ) {
if( !WebPAnimEncoderAdd( write->enc,
NULL, timestamp_ms - delay, NULL ) ) {
vips_error( "vips2webp",
"%s", _( "anim build error" ) );
return( -1 );