{"success":true,"data":{"ext":"jpeg","name":"Generic JPEG Image file","description":"JPEG (Joint Photographic Experts Group) is a raster image format developed by the Joint Photographic Experts Group and standardized by ISO and IEC for compressing photographic images. It is commonly used for digital photography, web images, email attachments, and general-purpose image sharing across devices and platforms. JPEG is a legacy but still widely supported format; its lossy compression can reduce image quality over repeated saves, and malformed files may occasionally trigger parser vulnerabilities in image viewers.","mime":["image/jpeg"],"risk_level":"Safe","signatures":[{"hex":"FF D8 FF","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":"FF D8 FF DB","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"FF D8","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"FF D8 FF E0 4A 46 49 46 00","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["jpe","jpg","jfif","jp2","avif","bmp"],"usage":{"python":"def is_jpeg(file_path: str) -> bool:\n    \"\"\"Check if file is a valid JPEG by magic bytes.\"\"\"\n    signature = bytes([0xFF, 0xD8, 0xFF])\n    with open(file_path, \"rb\") as f:\n        return f.read(3) == signature","node":"function isJPEG(buffer: Buffer): boolean {\n  const signature = Buffer.from([0xFF, 0xD8, 0xFF]);\n  return buffer.subarray(0, 3).equals(signature);\n}","go":"func IsJPEG(data []byte) bool {\n    signature := []byte{0xFF, 0xD8, 0xFF}\n    if len(data) < 3 {\n        return false\n    }\n    return bytes.Equal(data[:3], signature)\n}"},"category":"Images"}}