https://developers.google.com/speed/webp/docs/riff_container
I’ve got a WebP file (about 22 kilobytes), and the hexadecimal of the first 12 bytes is 524946461c57000057454250
.
The first and last 4 bytes make sense (ASCII "RIFF" and "WEBP"), but I don’t know what 1c570000
signifies. The doc says it is the file size, but that would be a huge file if it were hexadecimal 1c570000 bytes.
How do I calculate the file size (22 kilobytes) from the file header (reporting 1c570000
)?
As specified in the document (https://developers.google.com/speed/webp/docs/riff_container), the file size bytes are stored in Little Endian.
That is, the bytes are stored in the order of least significance to most significance (the least significant byte is at the first location, and the most significant byte is stored at the last location).
00 00 57 1c is 22,300, so "about 22 kilobytes" is correct.