[File] [PATCH 1/3] Display more info in case of extended WebP files

Emmanuel Gil Peyrot linkmauve at linkmauve.fr
Fri Apr 5 12:39:46 UTC 2024


This extended format supports animations, alpha, an ICC profile, and
EXIF or XMP metadata, unlike the Simple File Format.

I couldn’t figure out how to both apply a mask and add 1 to the values,
so the output is needlessly less readable.  This is the reason this
series is a draft.
---
 magic/Magdir/riff | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/magic/Magdir/riff b/magic/Magdir/riff
index 8552088a..ec9289c7 100644
--- a/magic/Magdir/riff
+++ b/magic/Magdir/riff
@@ -140,7 +140,7 @@
 >>&(4.l+4)  use riff-walk
 >0  string  fact
 >>&(4.l+4)  use riff-walk
->0  string  VP8
+>0  string  VP8\x20
 >>11		byte		0x9d
 >>>12		byte		0x01
 >>>>13		byte		0x2a	\b, VP8 encoding
@@ -158,6 +158,16 @@
 >>>>>15		byte&0x80	=0x80	\b, bad color specification
 >>>>>15		byte&0x40	=0x40	\b, no clamping required
 >>>>>15		byte&0x40	=0x00	\b, decoders should clamp
+>0  string  VP8X
+>>4		lelong		0x0a
+>>>8		byte		&0x02	\b, animated
+>>>8		byte		&0x04	\b, XMP metadata
+>>>8		byte		&0x08	\b, EXIF metadata
+>>>8		byte		&0x10	\b, with alpha
+>>>8		byte		&0x20	\b, ICC profile
+# TODO: These two values are off-by-one, for a 64x64 WebP they contain 63x63 as there can be no 0x0 file.
+>>>12		lelong&0xffffff	x	\b, %d+1
+>>>15		lelong&0xffffff	x	\bx%d+1
 #>0  string  x		we got %s
 #>>&(4.l+4)  use riff-walk
 
-- 
2.44.0



More information about the File mailing list