Sniffing Modern Media, 3D & OpenType Font Containers Without Trusting File Extensions
Browser File.type strings come from operating-system filename mappings rather than file bytes. In real user traffic, renamed iOS ftypheic photos, animated ftypavis sequences, Unknown-Size MediaRecorder WebM streams, and mis-padded SFNT font tables cause silent failures unless you inspect the binary header slice first.
Key Binary Signatures
- ISOBMFF (HEIC / HEIF / AVIF / AVIS): Bytes
4..7equal ASCIIftyp; major/compatible 4CC brands distinguish staticaviffrom animatedavisandheic/mif1. Try live in HEICExport and AVIFExport. - JPEG XL: Naked codestream
0xFF 0x0Aor 12-byteJXLbox (0x0000000C 4A584C20 0D0A870A) — decoded locally at AVIFExport JXL to JPG. - glTF 2.0 Binary (
.glb): Little-endian magic0x46546C67(glTF), version2, total byte length, andJSON+BINchunks — audited and converted to 3D-printable meshes at GLBViewerOnline (GLB to STL & OBJ). - WebM / Matroska & Ogg: EBML
1A 45 DF A3vs RFC 3533OggS(OpusHead/0x01vorbis) — inspected and converted at WebMToMP3. - OpenType SFNT & WOFF/WOFF2: Recomputing 32-bit big-endian table sums and setting
head.checkSumAdjustment = (0xB1B0AFBA - totalSum) >>> 0ensures unpacked desktop and EPUB fonts validate on Windows DirectWrite and Kindle/Kobo readers — live at WOFFToTTF, TTFToWOFF2, and MobiToEpub. - Systems & Struct Alignment: Verify C struct padding and big-endian network byte order interactively in Online C Compiler.