Bump version to 9.1.5 (#697)
Some checks failed
deploy / Deploy release (push) Has been cancelled
docker / build (push) Has been cancelled
oxipng / CI (push) Has been cancelled
oxipng / MSRV check (push) Has been cancelled

This commit is contained in:
andrews05 2025-04-26 11:19:57 +12:00 committed by GitHub
parent a44ba5f88b
commit c7d462f909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 28 additions and 17 deletions

View file

@ -1,3 +1,10 @@
## Version 9.1.5
- [Feature] Add `--sequential` option to process files sequentially rather than in parallel.
- [Performance] Update to latest Zopfli with greatly improved performance.
- [Improvement] Reduce memory usage.
- [Bugfix] Correct handling of grayscale conversion when ICC profile is present.
## Version 9.1.4 ## Version 9.1.4
- [Improvement] Improve optimization of APNG files (reductions still not supported yet). - [Improvement] Improve optimization of APNG files (reductions still not supported yet).

2
Cargo.lock generated
View file

@ -394,7 +394,7 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]] [[package]]
name = "oxipng" name = "oxipng"
version = "9.1.4" version = "9.1.5"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"clap", "clap",

View file

@ -20,7 +20,7 @@ homepage = "https://github.com/shssoichiro/oxipng"
license = "MIT" license = "MIT"
name = "oxipng" name = "oxipng"
repository = "https://github.com/shssoichiro/oxipng" repository = "https://github.com/shssoichiro/oxipng"
version = "9.1.4" version = "9.1.5"
rust-version = "1.74.0" rust-version = "1.74.0"
[badges] [badges]

View file

@ -1,4 +1,4 @@
oxipng 9.1.4 oxipng 9.1.5
Losslessly improve compression of PNG files Losslessly improve compression of PNG files
Usage: oxipng [OPTIONS] <files>... Usage: oxipng [OPTIONS] <files>...
@ -182,7 +182,15 @@ Options:
high compression levels. high compression levels.
-t, --threads <num> -t, --threads <num>
Set number of threads to use [default: num CPU cores] Set the maximum number of threads to use. Oxipng uses multithreading to evaluate multiple
optimizations on the same file in parallel as well as process multiple files in parallel.
You can set this to a lower value if you need to limit memory or CPU usage.
[default: num logical CPUs]
--sequential
Process multiple files sequentially rather than in parallel. Use this if you need
determinism in the processing order. Note this is not necessary if using '--threads 1'.
-h, --help -h, --help
Print help (see a summary with '-h') Print help (see a summary with '-h')

View file

@ -269,7 +269,7 @@ pub fn extract_icc(iccp: &Chunk) -> Option<Vec<u8>> {
Ok(icc) => Some(icc), Ok(icc) => Some(icc),
Err(e) => { Err(e) => {
// Log the error so we can know if the buffer size needs to be adjusted // Log the error so we can know if the buffer size needs to be adjusted
warn!("Failed to decompress icc: {}", e); warn!("Failed to decompress icc: {e}");
None None
} }
} }

View file

@ -183,7 +183,7 @@ impl RawImage {
/// Perform optimization on the input file using the options provided /// Perform optimization on the input file using the options provided
pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<()> { pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<()> {
// Read in the file and try to decode as PNG. // Read in the file and try to decode as PNG.
info!("Processing: {}", input); info!("Processing: {input}");
let deadline = Arc::new(Deadline::new(opts.timeout)); let deadline = Arc::new(Deadline::new(opts.timeout));
@ -207,7 +207,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
)) ))
}) })
.map(Some)?; .map(Some)?;
trace!("preserving metadata: {:?}", opt_metadata_preserved); trace!("preserving metadata: {opt_metadata_preserved:?}");
} else { } else {
opt_metadata_preserved = None; opt_metadata_preserved = None;
} }
@ -236,7 +236,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
(OutFile::Path { path, .. }, InFile::Path(ref input_path)) (OutFile::Path { path, .. }, InFile::Path(ref input_path))
if path.as_ref().map_or(true, |p| p == input_path) => if path.as_ref().map_or(true, |p| p == input_path) =>
{ {
info!("{}: Could not optimize further, no change written", input); info!("{input}: Could not optimize further, no change written");
return Ok(()); return Ok(());
} }
_ => { _ => {
@ -261,7 +261,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
match (output, input) { match (output, input) {
(OutFile::None, _) => { (OutFile::None, _) => {
info!("{}: Running in pretend mode, no output", savings); info!("{savings}: Running in pretend mode, no output");
} }
(&OutFile::StdOut, _) | (&OutFile::Path { path: None, .. }, &InFile::StdIn) => { (&OutFile::StdOut, _) | (&OutFile::Path { path: None, .. }, &InFile::StdIn) => {
let mut buffer = BufWriter::new(stdout()); let mut buffer = BufWriter::new(stdout());
@ -346,8 +346,8 @@ fn optimize_png(
raw.ihdr.width, raw.ihdr.height raw.ihdr.width, raw.ihdr.height
); );
report_format(" ", &raw); report_format(" ", &raw);
debug!(" IDAT size = {} bytes", idat_original_size); debug!(" IDAT size = {idat_original_size} bytes");
debug!(" File size = {} bytes", file_original_size); debug!(" File size = {file_original_size} bytes");
let mut opts = opts.to_owned(); let mut opts = opts.to_owned();
preprocess_chunks(&mut png.aux_chunks, &mut opts); preprocess_chunks(&mut png.aux_chunks, &mut opts);
@ -681,11 +681,7 @@ fn copy_times(_: &Metadata, _: &Path) -> PngResult<()> {
fn copy_times(input_path_meta: &Metadata, out_path: &Path) -> PngResult<()> { fn copy_times(input_path_meta: &Metadata, out_path: &Path) -> PngResult<()> {
let atime = filetime::FileTime::from_last_access_time(input_path_meta); let atime = filetime::FileTime::from_last_access_time(input_path_meta);
let mtime = filetime::FileTime::from_last_modification_time(input_path_meta); let mtime = filetime::FileTime::from_last_modification_time(input_path_meta);
trace!( trace!("attempting to set file times: atime: {atime:?}, mtime: {mtime:?}");
"attempting to set file times: atime: {:?}, mtime: {:?}",
atime,
mtime
);
filetime::set_file_times(out_path, atime, mtime).map_err(|err_io| { filetime::set_file_times(out_path, atime, mtime).map_err(|err_io| {
PngError::new(&format!( PngError::new(&format!(
"unable to set file times on {out_path:?}: {err_io}" "unable to set file times on {out_path:?}: {err_io}"

View file

@ -47,7 +47,7 @@ fn main() -> ExitCode {
let (out_file, out_dir, opts) = match parse_opts_into_struct(&matches) { let (out_file, out_dir, opts) = match parse_opts_into_struct(&matches) {
Ok(x) => x, Ok(x) => x,
Err(x) => { Err(x) => {
error!("{}", x); error!("{x}");
return ExitCode::FAILURE; return ExitCode::FAILURE;
} }
}; };