{"success":true,"data":{"ext":"webp","name":"GoogleWebP image file","description":"WebP is an image file format developed and maintained by Google for efficient storage of still and animated images. It is used on the web, in browsers, content management systems, and image editing tools to deliver photographs, graphics, and animations. The format is generally safe, though like other media files it should be obtained from trusted sources; support has expanded over time across major platforms and applications.","mime":["image/webp"],"risk_level":"Safe","signatures":[{"hex":"57 45 42 50","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Webp.cs"}]},{"hex":"52 49 46 46 2E 2E 2E 2E 57 45 42 50","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"52 49 46 46","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"52 49 46 46 57 45 42 50","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["avif","bmp","cr2","cr3","dib","exr"],"usage":{"python":"def is_webp(file_path: str) -> bool:\n    \"\"\"Check if file is a valid WEBP by magic bytes.\"\"\"\n    signature = bytes([0x57, 0x45, 0x42, 0x50])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isWEBP(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x57, 0x45, 0x42, 0x50]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsWEBP(data []byte) bool {\n    signature := []byte{0x57, 0x45, 0x42, 0x50}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Images"}}