{"success":true,"data":{"ext":"jb2","name":"JBIG2 image file","description":"JBIG2 image file is a bi-level image format standardized by the Joint Bi-level Image Experts Group and maintained through international standards bodies. It is primarily used for scanned documents, facsimile transmission, and document compression, and is often embedded within PDF files and imaging workflows. The format has been associated with compression-related security issues in document viewers, so files from untrusted sources should be handled with current software.","mime":["image/x-jbig2"],"risk_level":"Safe","signatures":[{"hex":"97 4A 42 32 0D 0A 1A 0A","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"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["jbig2"],"usage":{"python":"def is_jb2(file_path: str) -> bool:\n    \"\"\"Check if file is a valid JB2 by magic bytes.\"\"\"\n    signature = bytes([0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A])\n    with open(file_path, \"rb\") as f:\n        return f.read(8) == signature","node":"function isJB2(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A]);\n  return buffer.subarray(0, 8).equals(signature);\n}","go":"func IsJB2(data []byte) bool {\n    signature := []byte{0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A}\n    if len(data) < 8 {\n        return false\n    }\n    return bytes.Equal(data[:8], signature)\n}"},"category":"Images"}}