Skip to main content

detect_format_from_bytes

Function detect_format_from_bytes 

Source
pub fn detect_format_from_bytes(bytes: &[u8]) -> Option<DocumentFormat>
Expand description

Detects the document format from magic bytes only.

Used by the from_bytes read APIs and fuzz targets where no file path is available. ZIP magic (PK\x03\x04) maps to DOCX; the OLE2 container magic maps to legacy DOC.