Comment #1 on issue 319 by
jz...@google.com: some webp images created with PHP imagewebp display as white only in Chrome
https://bugs.chromium.org/p/webp/issues/detail?id=319#c1We don't maintain the implementation in php/imagewebp. I'm not sure what version of libwebp it's using to do encodes, but it looks like a quite dated one given the output.
The file header reports the files are 1 byte larger than they are [1]. The image (VP8) chunk's size looks to have been padded by 1 as adding a 0-byte to the end seems to clear it up. What may have happened was the image itself was odd sized and the chunk size was padded (incorrectly). A padding byte at the end of the image should have been added instead [2].
[1]
$ od -tx1 -N 48 -a superdentists_com.webp
0000000 52 49 46 46 f0 01 00 00 57 45 42 50 56 50 38 20
R I F F p soh nul nul W E B P V P 8 sp
0000020 e4 01 00 00 90 08 00 9d 01 2a 20 00 20 00 02 87
d soh nul nul dle bs nul gs soh * sp nul sp nul stx bel
0000040 08 85 85 88 85 84 88 88 82 02 ec 81 c6 ec f5 85
bs enq enq bs enq eot bs bs stx stx l soh F l u enq
ls -l superdentists_com.webp -> 503
file size = 0x1f0 = 496 + 8 = 504
image chunk size = 0x01e4 = 484 + 4 (size field length) + 16 (riff header + VP8) = 504
[2]
https://developers.google.com/speed/webp/docs/riff_container#riff_file_format