diff --git a/src/headers.rs b/src/headers.rs index 8a70a85e..adbdd3ba 100644 --- a/src/headers.rs +++ b/src/headers.rs @@ -76,7 +76,7 @@ pub enum StripChunks { None, /// Remove specific chunks Strip(IndexSet<[u8; 4]>), - /// Remove all chunks that won't affect rendering + /// Remove all chunks that won't affect image display Safe, /// Remove all non-critical chunks except these Keep(IndexSet<[u8; 4]>), @@ -85,8 +85,8 @@ pub enum StripChunks { } impl StripChunks { - /// List of chunks that will be kept when using the `Safe` option - pub const KEEP_SAFE: [[u8; 4]; 7] = [ + /// List of chunks that affect image display and will be kept when using the `Safe` option + pub const DISPLAY: [[u8; 4]; 7] = [ *b"cICP", *b"iCCP", *b"sRGB", *b"pHYs", *b"acTL", *b"fcTL", *b"fdAT", ]; @@ -95,7 +95,7 @@ impl StripChunks { StripChunks::None => true, StripChunks::Keep(names) => names.contains(name), StripChunks::Strip(names) => !names.contains(name), - StripChunks::Safe => Self::KEEP_SAFE.contains(name), + StripChunks::Safe => Self::DISPLAY.contains(name), StripChunks::All => false, } } diff --git a/src/main.rs b/src/main.rs index b83eabdf..44f281e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -163,7 +163,7 @@ CAUTION: 'all' will convert APNGs to standard PNGs. Note that 'bKGD', 'sBIT' and 'hIST' will be forcibly stripped if the color type or bit \ depth is changed, regardless of any options set.", - StripChunks::KEEP_SAFE + StripChunks::DISPLAY .iter() .map(|c| String::from_utf8_lossy(c)) .collect::>() @@ -632,7 +632,7 @@ fn parse_opts_into_struct( }) .collect::, _>>()?; if keep_display { - names.extend(StripChunks::KEEP_SAFE.iter().cloned()); + names.extend(StripChunks::DISPLAY.iter().cloned()); } opts.strip = StripChunks::Keep(names) }