parent
fa47c82617
commit
009066daf1
2 changed files with 0 additions and 19 deletions
10
src/lib.rs
10
src/lib.rs
|
|
@ -155,10 +155,6 @@ pub struct Options {
|
||||||
///
|
///
|
||||||
/// Default: `false`
|
/// Default: `false`
|
||||||
pub fix_errors: bool,
|
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.
|
/// Write to output even if there was no improvement in compression.
|
||||||
///
|
///
|
||||||
/// Default: `false`
|
/// Default: `false`
|
||||||
|
|
@ -308,7 +304,6 @@ impl Default for Options {
|
||||||
// Default settings based on -o 2 from the CLI interface
|
// Default settings based on -o 2 from the CLI interface
|
||||||
Options {
|
Options {
|
||||||
backup: false,
|
backup: false,
|
||||||
check: false,
|
|
||||||
fix_errors: false,
|
fix_errors: false,
|
||||||
force: false,
|
force: false,
|
||||||
filter: indexset! {RowFilter::None, RowFilter::Sub, RowFilter::Entropy, RowFilter::Bigrams},
|
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)?;
|
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.
|
// Run the optimizer on the decoded PNG.
|
||||||
let mut optimized_output = optimize_png(&mut png, &in_data, opts, deadline)?;
|
let mut optimized_output = optimize_png(&mut png, &in_data, opts, deadline)?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,13 +103,6 @@ fn main() {
|
||||||
.long("preserve")
|
.long("preserve")
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
|
||||||
Arg::new("check")
|
|
||||||
.help("Do not run any optimization passes")
|
|
||||||
.short('c')
|
|
||||||
.long("check")
|
|
||||||
.action(ArgAction::SetTrue),
|
|
||||||
)
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("pretend")
|
Arg::new("pretend")
|
||||||
.help("Do not write any files, only calculate compression gains")
|
.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.fix_errors = matches.get_flag("fix");
|
||||||
|
|
||||||
opts.check = matches.get_flag("check");
|
|
||||||
|
|
||||||
opts.bit_depth_reduction = !matches.get_flag("no-bit-reduction");
|
opts.bit_depth_reduction = !matches.get_flag("no-bit-reduction");
|
||||||
|
|
||||||
opts.color_type_reduction = !matches.get_flag("no-color-reduction");
|
opts.color_type_reduction = !matches.get_flag("no-color-reduction");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue