Closed nichbar closed 3 years ago
https://github.com/Piasy/BigImageViewer/issues/188 might be related .
Hi @nichbar , thanks for your contribution!
But why do you think we should check header[20]
instead of header[16]
? In Extended File Format
section of the doc, it says 12 bytes of WebP file header (12 bytes)
, then 4 bytes of ChunkHeader('VP8X')
, then the following byte is bit mask byte, which should be header[16]
, right?
@Piasy 新年好!
Sorry for the late response and undetailed explanation.
In
Extended File Format
section of the doc, it says 12 bytes ofWebP file header (12 bytes)
, then 4 bytes ofChucker('VP8X')
...
Here's the reason why we should check header[20]
instead of header[16]
.
Based on what google said on https://chromium.googlesource.com/webm/libwebp/+/master/doc/webp-container-spec.txt#132, what follow Chucker('VP8X')
is another 4 bytes of what called chunk_size
.
So the bit mask byte should be located at header[20]
.
This stackoverflow answer share the same idea.
The way that fresco use to determain animated webp support this idea too.
Hmm, interesting, seems the official doc is not very straight forward, anyway, thank you for the contribution!
v1.7.1
is released, check it out :)
The condition of determining animated WebP in BigImageViewer might be wrong.
Based on what google said in WebP Container Specification#Extended File Format, animation bit is in byte 21 instead of byte 17.
You may mistaken
ChunkHeader(VP8X)
as a 4-bytes data while it's 8 bytes instead.