{"success":true,"data":{"ext":"avif","name":"AV1 Image File Format","description":"AV1 Image File Format (AVIF) is a still-image file format developed and maintained by the Alliance for Open Media, based on the AV1 video codec. It is used for web graphics, digital photography, and other images where efficient compression and support for modern image features are required. AVIF is a current standard and is generally considered safe, though, like any image format, files from untrusted sources should be handled with updated software.","mime":["image/avif"],"risk_level":"Safe","signatures":[{"hex":"66 74 79 70 61 76 69 66","offset":4,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["cr3","heic","heif","bmp","cr2","dib"],"usage":{"python":"def is_avif(file_path: str) -> bool:\n    \"\"\"Check if file is a valid AVIF by magic bytes at offset 4.\"\"\"\n    signature = bytes([0x66, 0x74, 0x79, 0x70, 0x61, 0x76, 0x69, 0x66])\n    with open(file_path, \"rb\") as f:\n        f.seek(4)\n        return f.read(8) == signature","node":"function isAVIF(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x66, 0x74, 0x79, 0x70, 0x61, 0x76, 0x69, 0x66]);\n  if (buffer.length < 12) return false;\n  return buffer.subarray(4, 12).equals(signature);\n}","go":"func IsAVIF(data []byte) bool {\n    signature := []byte{0x66, 0x74, 0x79, 0x70, 0x61, 0x76, 0x69, 0x66}\n    if len(data) < 12 {\n        return false\n    }\n    return bytes.Equal(data[4:12], signature)\n}"},"category":"Images"}}