<div dir="auto"><div dir="auto">the spec basically says it reads the bytes of a VP8L chunk in big endian order, but the bits of each byte in reverse.</div><div dir="auto"><br></div><div dir="auto">so the 29th bit would be 4th byte & (1 << (7 - (32 - 29))) == 0x10.</div><div dir="auto">idk where the previous value 3rd byte & 0x01 came from.</div><div dir="auto"><br></div><div dir="auto">getting the image dimensions from this format is difficult because of this. per-byte bit reversal of a big-endian uint32_t (or per-word bit reversal of little-endian), then decode it into 2 packed 14-bit integers at the high end, then add 1... but at least a single bit is easy enough.</div><div dir="auto">---</div><div dir="auto"> magic/Magdir/riff | 2 +-</div><div dir="auto"> 1 file changed, 1 insertion(+), 1 deletion(-)</div><div dir="auto"><br></div><div dir="auto">diff --git a/magic/Magdir/riff b/magic/Magdir/riff</div><div dir="auto">index d5b6e738a..92d7a49b4 100644</div><div dir="auto">--- a/magic/Magdir/riff</div><div dir="auto">+++ b/magic/Magdir/riff</div><div dir="auto">@@ -161,7 +161,7 @@</div><div dir="auto"> >>>>>15<span style="white-space:pre">              </span>byte&0x40<span style="white-space:pre">        </span>=0x00<span style="white-space:pre">        </span>\b, decoders should clamp</div><div dir="auto"> >0  string  VP8L</div><div dir="auto"> >>8<span style="white-space:pre">          </span>byte<span style="white-space:pre">         </span>0x2f<span style="white-space:pre"> </span>\b, lossless</div><div dir="auto">->>>11<span style="white-space:pre">              </span>byte<span style="white-space:pre">         </span>&0x01<span style="white-space:pre">    </span>\b, with alpha</div><div dir="auto">+>>>12<span style="white-space:pre">            </span>byte<span style="white-space:pre">         </span>&0x10<span style="white-space:pre">    </span>\b, with alpha</div><div dir="auto"> >0  string  VP8X</div><div dir="auto"> >>4<span style="white-space:pre">             </span>lelong<span style="white-space:pre">               </span>0x0a</div><div dir="auto"> >>>8<span style="white-space:pre">              </span>byte<span style="white-space:pre">         </span>&0x02<span style="white-space:pre">    </span>\b, animated</div><div dir="auto"><br></div></div>