mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
gif2webp: force low duration frames to 100ms
this is consistent with web browser behavior as well as various transcoding tools (ffmpeg, gif2apng, etc). also: update anim_diff to account for this new behaviour. BUG=webp:379 Change-Id: I70cc72a6b401ef32b73cd182a3f12d993d495bf4
This commit is contained in:
committed by
Pascal Massimino
parent
b2db361ca6
commit
09333097ed
@ -593,6 +593,9 @@ static int ReadAnimatedGIF(const char filename[], AnimatedImage* const image,
|
||||
curr_frame = &image->frames[i];
|
||||
curr_rgba = curr_frame->rgba;
|
||||
curr_frame->duration = GetFrameDurationGIF(gif, i);
|
||||
// Force frames with a small or no duration to 100ms to be consistent
|
||||
// with web browsers and other transcoding tools (like gif2webp itself).
|
||||
if (curr_frame->duration <= 10) curr_frame->duration = 100;
|
||||
|
||||
if (i == 0) { // Initialize as transparent.
|
||||
curr_frame->is_key_frame = 1;
|
||||
|
Reference in New Issue
Block a user