Skip to main content

decode_xmp

Function decode_xmp 

Source
pub fn decode_xmp(bytes: &[u8]) -> Result<Xmp<'_>, DecodeError>
Expand description

Decode the Intel XMP 3.0 region from a raw SPD image.

Detects presence by the magic at offset 640. If absent, returns Xmp::Absent and reads nothing further. If present, decodes the header CRC and each enabled profile through SpdImage. Returns DecodeError::Truncated only if the image is long enough to hold the magic but too short for a byte a present profile reads. Never panics.