gif2webp: don't store loop-count if there's only 1 frame

BUG=webp:504

Change-Id: Iacea11a861096ae950379c872d9840bdbec42a21
This commit is contained in:
Pascal Massimino 2021-02-08 16:31:58 +01:00 committed by James Zern
parent 9c367bc602
commit 373eb170f1

View File

@ -465,8 +465,10 @@ int main(int argc, const char* argv[]) {
fprintf(stderr, "%s\n", WebPAnimEncoderGetError(enc)); fprintf(stderr, "%s\n", WebPAnimEncoderGetError(enc));
goto End; goto End;
} }
// If there's only one frame, we don't need to handle loop count.
if (!loop_compatibility) { if (frame_number == 1) {
loop_count = 0;
} else if (!loop_compatibility) {
if (!stored_loop_count) { if (!stored_loop_count) {
// if no loop-count element is seen, the default is '1' (loop-once) // if no loop-count element is seen, the default is '1' (loop-once)
// and we need to signal it explicitly in WebP. Note however that // and we need to signal it explicitly in WebP. Note however that