Skip to content

Commit

Permalink
release: 0.11.12
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Nov 29, 2024
2 parents 2a21f6b + 28b8fd6 commit 2c544a1
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 128 deletions.
161 changes: 94 additions & 67 deletions CREDITS.md

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,27 +151,3 @@ GTK3 is a whole other monster, requiring the `-dev` packages for (at least) ATK,
[This post](https://github.com/Blobfolio/refract/issues/3#issuecomment-1086924244) provides a good breakdown of how to set up a minimal Docker build environment for Refract.

If you end up building Refract on a non-Debian system — Red Hat, MacOS, etc. — please let us know what that setup looked like so we can update the docs. Users of those systems will no doubt appreciate it. :)



## License

See also: [CREDITS.md](CREDITS.md)

Copyright © 2024 [Blobfolio, LLC](https://blobfolio.com) <[email protected]>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ release_dir := justfile_directory() + "/release"

# Generate CREDITS.
@credits:
cargo bashman -m "{{ pkg_dir1 }}/Cargo.toml"
cargo bashman -m "{{ pkg_dir1 }}/Cargo.toml" -t x86_64-unknown-linux-gnu
just _fix-chown "{{ justfile_directory() }}/CREDITS.md"


Expand Down
10 changes: 5 additions & 5 deletions refract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "refract"
version = "0.11.11"
version = "0.11.12"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand All @@ -10,7 +10,7 @@ readme = "README.md"
publish = false

[package.metadata.deb]
maintainer = "Josh Stoik <hello@blobfolio.com>"
maintainer = "Josh Stoik <josh@blobfolio.com>"
copyright = "2024, Blobfolio, LLC <[email protected]>"
license-file = ["../LICENSE", "0"]
revision = "1"
Expand Down Expand Up @@ -89,16 +89,16 @@ description = "Image and/or directory paths to re-encode. Directories will be cr

[build-dependencies]
argyle = "0.10.*"
dowser = "0.9.*"
dowser = "0.10.*"
oxford_join = "0.4.*"
toml = "0.8.14"
version-compare = "0.2.*"

[dependencies]
argyle = "0.10.*"
crossbeam-channel = "0.5.*"
dactyl = "0.7.*"
dowser = "0.9.*"
dactyl = "0.8.*"
dowser = "0.10.*"
gtk = "=0.18.1"
oxford_join = "0.4.*"
write_atomic = "0.5.*"
Expand Down
2 changes: 1 addition & 1 deletion refract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn build_resources() {
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.map_or(false, |s| s.success()) {
.is_ok_and(|s| s.success()) {
panic!("Unable to bundle resources with glib-compile-resources; is GLIB installed?");
}

Expand Down
2 changes: 1 addition & 1 deletion refract/src/candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl TryFrom<&Input<'_>> for Candidate {
let row_size = src.row_size_i32()?;

Ok(Self {
buf: src.as_ref().to_vec().into_boxed_slice(),
buf: Box::from(src.as_ref()),
width,
height,
row_size,
Expand Down
12 changes: 4 additions & 8 deletions refract/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub(crate) const CLI_NO_YCBCR: u8 = 0b0010_0000;
///
/// This lets us bubble up startup errors so they can be pretty-printed.
fn main() {
match _main() {
match main__() {
Ok(()) => {},
Err(e @ (RefractError::PrintHelp | RefractError::PrintVersion)) => {
println!("{e}");
Expand All @@ -139,7 +139,7 @@ fn main() {
///
/// Any other kind of issue encountered will cause the application to fail, but
/// with a pretty CLI error reason.
fn _main() -> Result<(), RefractError> {
fn main__() -> Result<(), RefractError> {
init_resources()?;
let application = gtk::Application::new(
Some("com.refract.gtk"),
Expand All @@ -163,12 +163,8 @@ fn _main() -> Result<(), RefractError> {
Argument::Key("--no-ycbcr") => { flags |= CLI_NO_YCBCR; },
Argument::Key("-V" | "--version") => return Err(RefractError::PrintVersion),

Argument::KeyWithValue("-l" | "--list", s) => if let Ok(s) = std::fs::read_to_string(s) {
paths = paths.with_paths(s.lines().filter_map(|line| {
let line = line.trim();
if line.is_empty() { None }
else { Some(line) }
}));
Argument::KeyWithValue("-l" | "--list", s) => {
let _res = paths.read_paths_from_file(s);
},

// Assume paths.
Expand Down
20 changes: 10 additions & 10 deletions refract/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl Window {
let tx2 = tx.clone();
let rx2 = rx.clone();
std::thread::spawn(move || {
_encode_outer(paths, &encoders, flags, &tx2, &rx2);
encode_outer__(paths, &encoders, flags, &tx2, &rx2);
});

true
Expand Down Expand Up @@ -1085,10 +1085,10 @@ impl Window {
let _res = write!(
buf,
concat!("Created <b>{}</b> with {}.", log_colored!("#999", "(Saved {} bytes, {}.)")),
path.as_ref().to_string_lossy(),
path.as_ref().display(),
quality,
NiceU64::from(diff).as_str(),
NicePercent::from(per).as_str(),
NiceU64::from(diff),
NicePercent::from(per),
);
self.add_flag(FLAG_TICK_STATUS);
}
Expand Down Expand Up @@ -1172,15 +1172,15 @@ impl Window {
///
/// This is an outer wrapper over the individual file path(s). After all paths
/// have finished, it asks for the encoding lock to be removed.
fn _encode_outer(
fn encode_outer__(
paths: Vec<PathBuf>,
encoders: &[ImageKind],
flags: u8,
tx: &SisterTx,
rx: &SisterRx,
) {
for path in paths {
if let Err(e) = _encode(&path, encoders, flags, tx, rx) {
if let Err(e) = encode__(&path, encoders, flags, tx, rx) {
Share::sync(tx, rx, Err(e));
}
}
Expand All @@ -1194,7 +1194,7 @@ fn _encode_outer(
/// image. It will abort early if there are problems with the path, otherwise
/// it will guide the user through various qualities and save any "best"
/// candidates found.
fn _encode(
fn encode__(
path: &Path,
encoders: &[ImageKind],
flags: u8,
Expand All @@ -1208,7 +1208,7 @@ fn _encode(

// First, let's read the main input.
Share::sync(tx, rx, Ok(Share::Path(path.to_path_buf())));
let (src, can) = _encode_source(path)?;
let (src, can) = encode_source__(path)?;
if ShareFeedback::Abort == Share::sync(tx, rx, Ok(Share::Source(can))) {
// The status isn't actually OK, but errors are already known, so this
// prevents resubmitting the same error later.
Expand Down Expand Up @@ -1242,7 +1242,7 @@ fn _encode(
///
/// This generates an [`Input`] and [`Candidate`] object from a given file
/// path, or dies trying.
fn _encode_source(path: &Path) -> Result<(Input, Candidate), RefractError> {
fn encode_source__(path: &Path) -> Result<(Input, Candidate), RefractError> {
let raw: &[u8] = &std::fs::read(path).map_err(|_| RefractError::Read)?;
let out = Input::try_from(raw)?;
let can = Candidate::try_from(&out)?;
Expand All @@ -1261,7 +1261,7 @@ where W: WidgetExt {
/// # Is JPEG/PNG File.
pub(super) fn is_jpeg_png(path: &Path) -> bool {
Extension::try_from3(path).map_or_else(
|| Extension::try_from4(path).map_or(false, |e| e == E_JPEG),
|| Extension::try_from4(path) == Some(E_JPEG),
|e| e == E_JPG || e == E_PNG
)
}
Expand Down
6 changes: 3 additions & 3 deletions refract_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "refract_core"
version = "0.11.11"
version = "0.11.12"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand All @@ -10,7 +10,7 @@ readme = "README.md"
publish = false

[dependencies]
dactyl = "0.7.*"
dactyl = "0.8.*"
jpeg-decoder = "=0.3.1"
link-cplusplus = "=1.0.9"

Expand All @@ -20,7 +20,7 @@ default-features = false
features = [ "rust_backend" ]

[dependencies.jpegxl-sys]
version = "=0.11.1"
version = "=0.11.2"
default-features = false
features = [ "vendored" ]

Expand Down
2 changes: 1 addition & 1 deletion refract_core/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl TryFrom<&[u8]> for Input<'_> {
}

/// ## Getters.
impl<'a> Input<'a> {
impl Input<'_> {
#[inline]
#[must_use]
/// # Color Kind.
Expand Down
2 changes: 1 addition & 1 deletion release/completions/refract.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ _basher___refract() {
fi
[[ " ${COMP_LINE} " =~ " --no-avif " ]] || opts+=("--no-avif")
[[ " ${COMP_LINE} " =~ " --no-jxl " ]] || opts+=("--no-jxl")
[[ " ${COMP_LINE} " =~ " --no-webp " ]] || opts+=("--no-webp")
[[ " ${COMP_LINE} " =~ " --no-lossless " ]] || opts+=("--no-lossless")
[[ " ${COMP_LINE} " =~ " --no-lossy " ]] || opts+=("--no-lossy")
[[ " ${COMP_LINE} " =~ " --no-webp " ]] || opts+=("--no-webp")
[[ " ${COMP_LINE} " =~ " --no-ycbcr " ]] || opts+=("--no-ycbcr")
if [[ ! " ${COMP_LINE} " =~ " -V " ]] && [[ ! " ${COMP_LINE} " =~ " --version " ]]; then
opts+=("-V")
Expand Down
13 changes: 7 additions & 6 deletions release/man/refract.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.TH "REFRACT" "1" "October 2024" "refract v0.11.11" "User Commands"
.TH "REFRACT" "1" "November 2024" "refract v0.11.12" "User Commands"
.SH NAME
REFRACT \- Manual page for refract v0.11.11.
REFRACT \- Manual page for refract v0.11.12.
.SH DESCRIPTION
Guided AVIF/JPEG XL/WebP conversion for JPEG and PNG sources.
.SS USAGE:
Expand All @@ -17,15 +17,15 @@ Skip AVIF encoding.
\fB\-\-no\-jxl\fR
Skip JPEG\-XL encoding.
.TP
\fB\-\-no\-webp\fR
Skip WebP encoding.
.TP
\fB\-\-no\-lossless\fR
Skip lossless encoding passes.
.TP
\fB\-\-no\-lossy\fR
Skip lossy encoding passes.
.TP
\fB\-\-no\-webp\fR
Skip WebP encoding.
.TP
\fB\-\-no\-ycbcr\fR
Skip AVIF YCbCr encoding passes.
.TP
Expand All @@ -35,6 +35,7 @@ Print program version.
.TP
\fB\-l\fR, \fB\-\-list\fR <FILE>
Read (absolute) image and/or directory paths from this text file — or STDIN if '\-' — one path per line, instead of or in addition to those specified inline via <PATH(S)>.
.SS <PATH(S)…>:
.SS TRAILING:
.TP
\fB<PATH(s)…>\fR
Image and/or directory paths to re\-encode. Directories will be crawled recursively.

0 comments on commit 2c544a1

Please sign in to comment.