{"success":true,"data":{"ext":"jpg","name":"Digital camera JPG usingExchangeable Image File Format","description":"JPEG (JPG) is a raster image file format developed by the Joint Photographic Experts Group and standardized by ISO/IEC for compressing digital photographs and other continuous-tone images. It is commonly used for camera photos, web graphics, email attachments, and general image exchange across operating systems and devices. The format is widely supported and generally safe, though malformed files or decoder vulnerabilities can occasionally affect image viewers and libraries.","mime":["image/jpeg"],"risk_level":"Safe","signatures":[{"hex":"FF D8","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Jpeg.cs"}]},{"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 FF E0","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"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"}]},{"hex":"FF D8 FF E1 45 78 69 66 00","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"FF D8 FF E8 53 50 49 46 46 00","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["jpe","jpeg","cr2","avif","bmp","cr3"],"usage":{"python":"def is_jpg(file_path: str) -> bool:\n    \"\"\"Check if file is a valid JPG by magic bytes.\"\"\"\n    signature = bytes([0xFF, 0xD8])\n    with open(file_path, \"rb\") as f:\n        return f.read(2) == signature","node":"function isJPG(buffer: Buffer): boolean {\n  const signature = Buffer.from([0xFF, 0xD8]);\n  return buffer.subarray(0, 2).equals(signature);\n}","go":"func IsJPG(data []byte) bool {\n    signature := []byte{0xFF, 0xD8}\n    if len(data) < 2 {\n        return false\n    }\n    return bytes.Equal(data[:2], signature)\n}"},"category":"Images"}}