Revert "Add check option"

This reverts commit 9054b2d947.
This commit is contained in:
Andrew 2023-08-05 09:34:09 +12:00
parent fa47c82617
commit 009066daf1
2 changed files with 0 additions and 19 deletions

View file

@ -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)?;

View file

@ -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");