diff --git a/CHANGELOG.md b/CHANGELOG.md index faf0b584..dfac8ec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -**Version 0.3.1 (unreleased)** +**Version 0.4.0 (unreleased)** - Performance optimizations + - [SEMVER_MAJOR] `-s` automatically infers `--strip safe` **Version 0.3.0** - Properly decode interlaced images diff --git a/src/main.rs b/src/main.rs index 0455ae46..90e241bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -204,8 +204,12 @@ fn main() { .arg(Arg::with_name("strip") .help("Strip metadata objects ['safe', 'all', or comma-separated list]") .long("strip") + .takes_value(true) + .conflicts_with("strip-safe")) + .arg(Arg::with_name("strip-safe") + .help("Strip safely-removable metadata objects") .short("s") - .takes_value(true)) + .conflicts_with("strip")) .after_help("Optimization levels: -o 0 => --zc 3 --nz (0 or 1 trials) -o 1 => --zc 9 (1 trial, determined heuristically) @@ -504,6 +508,10 @@ fn parse_opts_into_struct(matches: &ArgMatches, opts: &mut oxipng::Options) -> R } } + if matches.is_present("strip-safe") { + opts.strip = png::Headers::Safe; + } + Ok(()) }