gif2webp: introduce -loop_compatibility option

This patch fixes the compatibility for loop-count handling.
This aims at addressing the change in Chrome handling of loop-count
prior to M63.

Before M63: loop-count interpretation was aligned to GIF's behaviour in
Chrome, but incompatible with WebP's spec. In particular, you couldn't
loop exactly once.

Post-M63: loop-count in WebP is really the total number of loops. Gif2webp
will convert correctly from a GIF source by adjusting the loop count.

Note: The Chrome version can be retrieved from the User-Agent
string (chrome://version).
An M63 version will contain the pattern:
   Chrome/63.x.xxxx.xx
for instance.

Change-Id: Ie6dc13227e6498f4d7af2f09247913648997648a
This commit is contained in:
Pascal Massimino
2017-09-18 23:38:09 -07:00
parent 8635973dc3
commit b4e046778d
3 changed files with 29 additions and 5 deletions

View File

@ -1,5 +1,5 @@
.\" Hey, EMACS: -*- nroff -*-
.TH GIF2WEBP 1 "January 25, 2017"
.TH GIF2WEBP 1 "September 20, 2017"
.SH NAME
gif2webp \- Convert a GIF image to WebP
.SH SYNOPSIS
@ -109,6 +109,9 @@ the range of 20 to 50.
.TP
.B \-mt
Use multi-threading for encoding, if possible.
.B \-loop_compatibility
If enabled, handle the loop information in a compatible fashion for Chrome
version prior to M62 (inclusive) and Firefox.
.TP
.B \-v
Print extra information.