From 009066daf1433a7e994589e04a13c14c0b4627cc Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 5 Aug 2023 09:34:09 +1200 Subject: [PATCH] Revert "Add check option" This reverts commit 9054b2d9471e2a357d21fd0d61013390aea4423b. --- src/lib.rs | 10 ---------- src/main.rs | 9 --------- 2 files changed, 19 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c0c53e4a..ec669dad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -155,10 +155,6 @@ pub struct Options { /// /// Default: `false` pub fix_errors: bool, - /// Don't actually run any optimizations, just parse the PNG file. - /// - /// Default: `false` - pub check: bool, /// Write to output even if there was no improvement in compression. /// /// Default: `false` @@ -308,7 +304,6 @@ impl Default for Options { // Default settings based on -o 2 from the CLI interface Options { backup: false, - check: false, fix_errors: false, force: false, filter: indexset! {RowFilter::None, RowFilter::Sub, RowFilter::Entropy, RowFilter::Bigrams}, @@ -462,11 +457,6 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<( let mut png = PngData::from_slice(&in_data, opts)?; - if opts.check { - info!("Running in check mode, not optimizing"); - return Ok(()); - } - // Run the optimizer on the decoded PNG. let mut optimized_output = optimize_png(&mut png, &in_data, opts, deadline)?; diff --git a/src/main.rs b/src/main.rs index db1eabe2..5c865d8e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,13 +103,6 @@ fn main() { .long("preserve") .action(ArgAction::SetTrue), ) - .arg( - Arg::new("check") - .help("Do not run any optimization passes") - .short('c') - .long("check") - .action(ArgAction::SetTrue), - ) .arg( Arg::new("pretend") .help("Do not write any files, only calculate compression gains") @@ -498,8 +491,6 @@ fn parse_opts_into_struct( opts.fix_errors = matches.get_flag("fix"); - opts.check = matches.get_flag("check"); - opts.bit_depth_reduction = !matches.get_flag("no-bit-reduction"); opts.color_type_reduction = !matches.get_flag("no-color-reduction");