diff --git a/pixeldata/src/attribute.rs b/pixeldata/src/attribute.rs index a64c3d91f..e1ed3025b 100644 --- a/pixeldata/src/attribute.rs +++ b/pixeldata/src/attribute.rs @@ -491,8 +491,7 @@ pub fn photometric_interpretation( .context(MissingRequiredSnafu { name })? .string() .context(CastValueSnafu { name })? - .trim() - .trim_matches(char::from(0)) + .trim_matches(|c: char| c.is_whitespace() || c == '\0') .into()) }