{"success":true,"data":{"ext":"mdi","name":"Microsoft Document Imaging file","description":"Microsoft Document Imaging (MDI) is a raster image file format created by Microsoft for use with the Microsoft Office Document Imaging and Office Document Scanning applications. It was commonly used to store scanned documents, faxes, and multipage images for viewing, annotation, and optical character recognition workflows. The format is now largely legacy, and although generally safe to open, files from untrusted sources should still be handled with standard caution.","mime":["image/vnd.ms-modi"],"risk_level":"Safe","signatures":[{"hex":"45 50 2A 00","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":"45 50","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":[],"usage":{"python":"def is_mdi(file_path: str) -> bool:\n    \"\"\"Check if file is a valid MDI by magic bytes.\"\"\"\n    signature = bytes([0x45, 0x50, 0x2A, 0x00])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isMDI(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x45, 0x50, 0x2A, 0x00]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsMDI(data []byte) bool {\n    signature := []byte{0x45, 0x50, 0x2A, 0x00}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Images"}}