Skip to main content

Module file_info

Module file_info 

Source
Expand description

File type detection and metadata extraction.

detect_mime sniffs the first bytes of a file for its true MIME type, regardless of file extension. FileMetadata carries optional width, height, and duration extracted from common formats.

Structs§

FileInfo
Detected MIME type and optional media metadata.

Functions§

detect_mime
Detect MIME type from file bytes using magic-byte signatures.
file_info
Extract all available metadata from file bytes.
file_info_from_path
Extract metadata from a file on disk without loading it fully into memory.