Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qrtool for openSUSE:Factory checked in at 2024-07-04 16:26:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qrtool (Old) and /work/SRC/openSUSE:Factory/.qrtool.new.2080 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "qrtool" Thu Jul 4 16:26:38 2024 rev:4 rq:1185240 version:0.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qrtool/qrtool.changes 2024-06-29 15:17:32.680481399 +0200 +++ /work/SRC/openSUSE:Factory/.qrtool.new.2080/qrtool.changes 2024-07-04 16:27:41.233178900 +0200 @@ -1,0 +2,8 @@ +Wed Jul 3 20:46:09 UTC 2024 - Muhammad Akbar Yanuar Mantari <mantarimay@pm.me> + +- Update to version 0.11.0 + * Change --zopfli to allow it to take a value. If the value is + not specified, it is assumed that 15 is specified. This is the + same as before the change + +------------------------------------------------------------------- Old: ---- qrtool-0.10.13.tar.gz New: ---- qrtool-0.11.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qrtool.spec ++++++ --- /var/tmp/diff_new_pack.ncreUZ/_old 2024-07-04 16:27:42.941241253 +0200 +++ /var/tmp/diff_new_pack.ncreUZ/_new 2024-07-04 16:27:42.941241253 +0200 @@ -22,7 +22,7 @@ %bcond_without test %endif Name: qrtool -Version: 0.10.13 +Version: 0.11.0 Release: 0 Summary: An utility for encoding or decoding QR code License: MIT AND CC-BY-4.0 AND Apache-2.0 ++++++ qrtool-0.10.13.tar.gz -> qrtool-0.11.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/CHANGELOG.adoc new/qrtool-0.11.0/CHANGELOG.adoc --- old/qrtool-0.10.13/CHANGELOG.adoc 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/CHANGELOG.adoc 2024-07-03 18:27:00.000000000 +0200 @@ -14,6 +14,14 @@ The format is based on https://keepachangelog.com/[Keep a Changelog], and this project adheres to https://semver.org/[Semantic Versioning]. +== {compare-url}/v0.10.13\...v0.11.0[0.11.0] - 2024-07-03 + +=== Changed + +* Change `--zopfli` to allow it to take a value. If the value is not specified, + it is assumed that 15 is specified. This is the same as before the change + ({pull-request-url}/534[#534]) + == {compare-url}/v0.10.12\...v0.10.13[0.10.13] - 2024-06-29 === Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/Cargo.lock new/qrtool-0.11.0/Cargo.lock --- old/qrtool-0.10.13/Cargo.lock 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/Cargo.lock 2024-07-03 18:27:00.000000000 +0200 @@ -196,9 +196,9 @@ [[package]] name = "cc" -version = "1.0.101" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" [[package]] name = "cfg-if" @@ -823,7 +823,7 @@ [[package]] name = "qrtool" -version = "0.10.13" +version = "0.11.0" dependencies = [ "anyhow", "assert_cmd", @@ -1116,9 +1116,9 @@ [[package]] name = "sysexits" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaeada5433f30b34f25f70784cfc22b05d06a32eaa7e598b1433ecffb27e9499" +checksum = "c4008983d29e823b1415f5f12732d5c9a44059795fb6218262cc0185668851e2" [[package]] name = "tap" @@ -1410,18 +1410,18 @@ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/Cargo.toml new/qrtool-0.11.0/Cargo.toml --- old/qrtool-0.10.13/Cargo.toml 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/Cargo.toml 2024-07-03 18:27:00.000000000 +0200 @@ -4,7 +4,7 @@ [package] name = "qrtool" -version = "0.10.13" +version = "0.11.0" authors = ["Shun Sakai <sorairolake@protonmail.ch>"] edition = "2021" rust-version = "1.74.0" @@ -30,7 +30,7 @@ qrcode = "0.14.0" resvg = { version = "0.42.0", default-features = false, optional = true } rqrr = "0.7.1" -sysexits = "0.8.0" +sysexits = "0.8.1" [dev-dependencies] assert_cmd = "2.0.14" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/docs/man/man1/qrtool-encode.1.adoc new/qrtool-0.11.0/docs/man/man1/qrtool-encode.1.adoc --- old/qrtool-0.10.13/docs/man/man1/qrtool-encode.1.adoc 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/docs/man/man1/qrtool-encode.1.adoc 2024-07-03 18:27:00.000000000 +0200 @@ -4,7 +4,7 @@ = qrtool-encode(1) // Specify in UTC. -:docdate: 2024-06-29 +:docdate: 2024-07-02 :doctype: manpage ifdef::revnumber[:mansource: qrtool {revnumber}] ifndef::revnumber[:mansource: qrtool] @@ -116,8 +116,8 @@ *--optimize-png* [_LEVEL_]:: Set the optimization level for a PNG image. Lower levels are faster, higher - levels provide better compression. If the value is not specified, it is - assumed that the default level 2 is specified. + levels provide better compression. If _LEVEL_ is not specified, it is assumed + that the default level 2 is specified. The possible values are:{blank}::: @@ -155,9 +155,12 @@ endif::[] ifdef::optimize-output-png,env-github,site-gen-antora[] -*--zopfli*:: +*--zopfli* [_ITERATION_]:: - Use Zopfli to compress PNG image. This option requires *--optimize-png*. + Use Zopfli to compress PNG image. Perform compression for the number of + iterations specified by _ITERATION_. If _ITERATION_ is not specified, it is + assumed that 15 is specified as the number of iterations. This option + requires *--optimize-png*. endif::[] *--mode* _MODE_:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/src/app.rs new/qrtool-0.11.0/src/app.rs --- old/qrtool-0.10.13/src/app.rs 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/src/app.rs 2024-07-03 18:27:00.000000000 +0200 @@ -110,10 +110,7 @@ #[cfg(feature = "optimize-output-png")] if let Some(level) = arg.optimize_png { let mut optimize_opt = oxipng::Options::from_preset(level.into()); - if arg.zopfli { - let iterations = std::num::NonZeroU8::new(15).expect( - "the number of compression iterations should be non-zero", - ); + if let Some(iterations) = arg.zopfli { optimize_opt.deflate = oxipng::Deflaters::Zopfli { iterations }; } buf = oxipng::optimize_from_memory(&buf, &optimize_opt) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/src/cli.rs new/qrtool-0.11.0/src/cli.rs --- old/qrtool-0.10.13/src/cli.rs 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/src/cli.rs 2024-07-03 18:27:00.000000000 +0200 @@ -42,8 +42,8 @@ "See `qrtool-decode(1)` for more details." ); -#[allow(clippy::struct_excessive_bools)] #[derive(Debug, Parser)] +#[allow(clippy::struct_excessive_bools)] #[command( version, long_version(LONG_VERSION), @@ -155,7 +155,7 @@ /// Set the optimization level for a PNG image. /// /// Lower levels are faster, higher levels provide better compression. If - /// the value is not specified, it is assumed that the default level 2 is + /// <LEVEL> is not specified, it is assumed that the default level 2 is /// specified. #[cfg(feature = "optimize-output-png")] #[arg( @@ -169,9 +169,19 @@ pub optimize_png: Option<PngOptimizationLevel>, /// Use Zopfli to compress PNG image. + /// + /// Perform compression for the number of iterations specified by + /// <ITERATION>. If <ITERATION> is not specified, it is assumed that 15 is + /// specified as the number of iterations. #[cfg(feature = "optimize-output-png")] - #[arg(long, requires("optimize_png"))] - pub zopfli: bool, + #[arg( + long, + requires("optimize_png"), + num_args(0..=1), + value_name("ITERATION"), + default_missing_value("15") + )] + pub zopfli: Option<std::num::NonZeroU8>, /// The mode of the output. /// @@ -294,8 +304,8 @@ } } -#[allow(clippy::doc_markdown)] #[derive(Clone, Debug, ValueEnum)] +#[allow(clippy::doc_markdown)] #[value(rename_all = "lower")] pub enum Shell { /// Bash. @@ -460,8 +470,8 @@ Micro, } -#[allow(clippy::doc_markdown)] #[derive(Clone, Debug, ValueEnum)] +#[allow(clippy::doc_markdown)] #[value(rename_all = "lower")] pub enum InputFormat { /// Windows Bitmap. @@ -605,8 +615,8 @@ assert_eq!(OutputFormat::default(), OutputFormat::Png); } - #[test] #[cfg(feature = "optimize-output-png")] + #[test] fn from_png_optimization_level_to_u8() { assert_eq!(u8::from(PngOptimizationLevel::Level0), 0); assert_eq!(u8::from(PngOptimizationLevel::Level1), 1); @@ -695,8 +705,8 @@ ); } - #[test] #[cfg(feature = "decode-from-svg")] + #[test] fn try_from_input_format_to_image_format_when_svg() { assert!(ImageFormat::try_from(InputFormat::Svg).is_err()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/src/decode.rs new/qrtool-0.11.0/src/decode.rs --- old/qrtool-0.10.13/src/decode.rs 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/src/decode.rs 2024-07-03 18:27:00.000000000 +0200 @@ -83,15 +83,15 @@ mod tests { use super::*; - #[test] #[cfg(feature = "decode-from-svg")] + #[test] fn valid_extension_as_svg() { assert!(is_svg("image.svg")); assert!(is_svg("image.svgz")); } - #[test] #[cfg(feature = "decode-from-svg")] + #[test] fn invalid_extension_as_svg() { assert!(!is_svg("image.png")); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/tests/decode.rs new/qrtool-0.11.0/tests/decode.rs --- old/qrtool-0.10.13/tests/decode.rs 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/tests/decode.rs 2024-07-03 18:27:00.000000000 +0200 @@ -73,8 +73,8 @@ )); } -#[test] #[cfg(feature = "decode-from-bmp")] +#[test] fn decode_from_bmp() { utils::command::command() .arg("decode") @@ -102,8 +102,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-dds")] +#[test] fn decode_from_dds() { utils::command::command() .arg("decode") @@ -131,8 +131,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-ff")] +#[test] fn decode_from_farbfeld() { utils::command::command() .arg("decode") @@ -160,8 +160,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-gif")] +#[test] fn decode_from_gif() { utils::command::command() .arg("decode") @@ -189,8 +189,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-hdr")] +#[test] fn decode_from_hdr() { utils::command::command() .arg("decode") @@ -218,8 +218,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-ico")] +#[test] fn decode_from_bmp_cur() { utils::command::command() .arg("decode") @@ -240,8 +240,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-ico")] +#[test] fn decode_from_png_cur() { utils::command::command() .arg("decode") @@ -262,8 +262,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-ico")] +#[test] fn decode_from_bmp_ico() { utils::command::command() .arg("decode") @@ -281,8 +281,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-ico")] +#[test] fn decode_from_png_ico() { utils::command::command() .arg("decode") @@ -300,8 +300,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-ico")] +#[test] fn decode_from_ico_with_wrong_format() { utils::command::command() .arg("decode") @@ -314,8 +314,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-jpeg")] +#[test] fn decode_from_jpeg() { utils::command::command() .arg("decode") @@ -343,8 +343,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-exr")] +#[test] fn decode_from_open_exr() { utils::command::command() .arg("decode") @@ -394,8 +394,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_ascii_pbm() { utils::command::command() .arg("decode") @@ -413,8 +413,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_ascii_pgm() { utils::command::command() .arg("decode") @@ -432,8 +432,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_ascii_ppm() { utils::command::command() .arg("decode") @@ -451,8 +451,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_binary_pbm() { utils::command::command() .arg("decode") @@ -470,8 +470,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_binary_pgm() { utils::command::command() .arg("decode") @@ -489,8 +489,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_binary_ppm() { utils::command::command() .arg("decode") @@ -508,8 +508,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-pnm")] +#[test] fn decode_from_pnm_with_wrong_format() { utils::command::command() .arg("decode") @@ -522,8 +522,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-qoi")] +#[test] fn decode_from_qoi() { utils::command::command() .arg("decode") @@ -551,8 +551,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-svg")] +#[test] fn decode_from_svg() { utils::command::command() .arg("decode") @@ -570,8 +570,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-svg")] +#[test] fn decode_from_svgz() { utils::command::command() .arg("decode") @@ -589,8 +589,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-svg")] +#[test] fn decode_from_svg_with_wrong_format() { utils::command::command() .arg("decode") @@ -603,8 +603,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-tga")] +#[test] fn decode_from_tga() { utils::command::command() .arg("decode") @@ -632,8 +632,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-tiff")] +#[test] fn decode_from_tiff() { utils::command::command() .arg("decode") @@ -661,8 +661,8 @@ .stderr(predicate::str::contains("could not read the image")); } -#[test] #[cfg(feature = "decode-from-webp")] +#[test] fn decode_from_lossy_web_p() { utils::command::command() .arg("decode") @@ -680,8 +680,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-webp")] +#[test] fn decode_from_lossless_web_p() { utils::command::command() .arg("decode") @@ -699,8 +699,8 @@ .stdout(predicate::eq("QR code")); } -#[test] #[cfg(feature = "decode-from-webp")] +#[test] fn decode_from_web_p_with_wrong_format() { utils::command::command() .arg("decode") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qrtool-0.10.13/tests/encode.rs new/qrtool-0.11.0/tests/encode.rs --- old/qrtool-0.10.13/tests/encode.rs 2024-06-29 03:56:59.000000000 +0200 +++ new/qrtool-0.11.0/tests/encode.rs 2024-07-03 18:27:00.000000000 +0200 @@ -474,9 +474,9 @@ )); } -#[allow(clippy::too_many_lines)] -#[test] #[cfg(feature = "optimize-output-png")] +#[test] +#[allow(clippy::too_many_lines)] fn encode_to_optimized_png() { let default_output = utils::command::command() .arg("encode") @@ -627,8 +627,8 @@ assert!(level6_output.status.success()); } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_maximum_optimized_png() { let level6_output = utils::command::command() .arg("encode") @@ -661,8 +661,8 @@ assert!(max_output.status.success()); } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_optimized_png_without_value() { let level2_output = utils::command::command() .arg("encode") @@ -697,8 +697,8 @@ assert!(without_value_output.status.success()); } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_optimized_png_with_invalid_level() { utils::command::command() .arg("encode") @@ -715,8 +715,8 @@ )); } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_optimized_png_with_invalid_output_format() { { utils::command::command() @@ -746,8 +746,8 @@ } } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_optimized_png_using_zopfli() { let without_value_output = utils::command::command() .arg("encode") @@ -758,35 +758,58 @@ .output() .unwrap(); - let zopfli_output = utils::command::command() + let zopfli_5_iterations_output = utils::command::command() .arg("encode") .arg("-t") .arg("png") .arg("--optimize-png") .arg("--zopfli") + .arg("5") .arg("QR code") .output() .unwrap(); assert_eq!( DynamicImage::ImageLuma8( - image::load_from_memory(&zopfli_output.stdout) + image::load_from_memory(&zopfli_5_iterations_output.stdout) .unwrap() .to_luma8() ), image::open("tests/data/encode/encode.png").unwrap() ); - assert!(zopfli_output.stdout.len() < without_value_output.stdout.len()); - assert!(zopfli_output.status.success()); + assert!(zopfli_5_iterations_output.stdout.len() < without_value_output.stdout.len()); + assert!(zopfli_5_iterations_output.status.success()); + + let zopfli_default_iterations_output = utils::command::command() + .arg("encode") + .arg("--optimize-png") + .arg("--zopfli") + .arg("-t") + .arg("png") + .arg("QR code") + .output() + .unwrap(); + assert_eq!( + DynamicImage::ImageLuma8( + image::load_from_memory(&zopfli_default_iterations_output.stdout) + .unwrap() + .to_luma8() + ), + image::open("tests/data/encode/encode.png").unwrap() + ); + assert!( + zopfli_default_iterations_output.stdout.len() < zopfli_5_iterations_output.stdout.len() + ); + assert!(zopfli_default_iterations_output.status.success()); } -#[test] #[cfg(feature = "optimize-output-png")] +#[test] fn encode_to_optimized_png_using_zopfli_without_level() { utils::command::command() .arg("encode") + .arg("--zopfli") .arg("-t") .arg("png") - .arg("--zopfli") .arg("QR code") .assert() .failure() @@ -797,6 +820,49 @@ .stderr(predicate::str::contains("--optimize-png [<LEVEL>]")); } +#[cfg(feature = "optimize-output-png")] +#[test] +fn encode_to_optimized_png_using_zopfli_with_invalid_value() { + { + utils::command::command() + .arg("encode") + .arg("-t") + .arg("png") + .arg("--optimize-png") + .arg("--zopfli") + .arg("0") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value '0' for '--zopfli [<ITERATION>]'", + )) + .stderr(predicate::str::contains( + "number would be zero for non-zero type", + )); + } + { + utils::command::command() + .arg("encode") + .arg("-t") + .arg("png") + .arg("--optimize-png") + .arg("--zopfli") + .arg("256") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value '256' for '--zopfli [<ITERATION>]'", + )) + .stderr(predicate::str::contains( + "number too large to fit in target type", + )); + } +} + #[test] fn encode_in_numeric_mode() { let output = utils::command::command() ++++++ vendor.tar.zst ++++++ /work/SRC/openSUSE:Factory/qrtool/vendor.tar.zst /work/SRC/openSUSE:Factory/.qrtool.new.2080/vendor.tar.zst differ: char 996609, line 4082