Skip to main content

validate_icc_structure

Function validate_icc_structure 

Source
pub fn validate_icc_structure(bytes: &[u8]) -> Result<(), IccValidationError>
Expand description

Validate an ICC profile’s structural framing per ISO 15076-1 / ICC.1:

  • Minimum length of 132 bytes (128-byte header + 4-byte tag count)
  • 'acsp' magic signature at bytes 36..40
  • Big-endian declared profile size in bytes 0..4 (132 <= declared_size <= bytes.len())
  • Image color profile class in bytes 12..16 (mntr, scnr, prtr, or spac; rejects DeviceLink link, Abstract abst, NamedColor nmcl, and zero/unknown classes)
  • Tag table length and every tag entry’s (offset, size) span strictly within [table_end, declared_size]

Does not allocate and requires no icc feature tables.