Skip to main content

detect_format_from_bytes

Function detect_format_from_bytes 

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

Detect the file format from the first bytes of a file (magic bytes).

Returns the file extension (e.g., "rrd", "mcap", "png") if the format is recognized.

Delegates to re_sdk_types::components::MediaType::guess_from_data which handles Robotics-specific formats (RRD, MCAP, PLY) and standard formats (PNG, JPEG, GLB, MP4, etc.).