From 4414d2f4b2363aaabae9fafadd0906ed4434fe7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= <150025636+git-f0x@users.noreply.github.com> Date: Sat, 14 Mar 2026 22:20:51 +0100 Subject: [PATCH] chore: update dependencies Also utilizes the `jxl-oxide` image decoding hook. --- Cargo.lock | 82 +++++++++++++---------------------------------------- Cargo.toml | 10 +++---- src/main.rs | 1 + src/tab.rs | 59 ++++++++++---------------------------- 4 files changed, 40 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e4753b..b277508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1215,9 +1215,9 @@ checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "core-foundation" @@ -1309,26 +1309,13 @@ dependencies = [ "libm", ] -[[package]] -name = "cosmic-client-toolkit" -version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" -dependencies = [ - "bitflags 2.11.0", - "cosmic-protocols 0.1.0", - "libc", - "smithay-client-toolkit", - "wayland-client", - "wayland-protocols", -] - [[package]] name = "cosmic-client-toolkit" version = "0.2.0" source = "git+https://github.com/pop-os/cosmic-protocols?rev=160b086#160b086abe03cd34a8a375d7fbe47b24308d1f38" dependencies = [ "bitflags 2.11.0", - "cosmic-protocols 0.2.0", + "cosmic-protocols", "libc", "smithay-client-toolkit", "wayland-client", @@ -1373,7 +1360,7 @@ dependencies = [ "bzip2", "chrono", "compio", - "cosmic-client-toolkit 0.1.0", + "cosmic-client-toolkit", "cosmic-mime-apps", "dirs 6.0.0", "env_logger", @@ -1461,20 +1448,6 @@ dependencies = [ "xdg", ] -[[package]] -name = "cosmic-protocols" -version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" -dependencies = [ - "bitflags 2.11.0", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-wlr", - "wayland-scanner", - "wayland-server", -] - [[package]] name = "cosmic-protocols" version = "0.2.0" @@ -1559,21 +1532,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - [[package]] name = "crc32fast" version = "1.5.0" @@ -2386,9 +2344,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "fork" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29714eb48a54d35d6f107e38cc58003f2e26825f222119db8369d28b24b79f2a" +checksum = "5bcc4b4161e53d499e41af904acb23950adf85682c772921ef3957cf1ecc98b3" dependencies = [ "libc", ] @@ -2590,11 +2548,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", - "js-sys", "libc", "r-efi 5.3.0", "wasip2", - "wasm-bindgen", ] [[package]] @@ -2604,10 +2560,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi 6.0.0", "wasip2", "wasip3", + "wasm-bindgen", ] [[package]] @@ -3075,7 +3033,7 @@ source = "git+https://github.com/pop-os/libcosmic.git#9602dfd2f12b667e0afacdccd0 dependencies = [ "bitflags 2.11.0", "bytes", - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "dnd", "glam", "lilt", @@ -3164,7 +3122,7 @@ version = "0.14.0" source = "git+https://github.com/pop-os/libcosmic.git#9602dfd2f12b667e0afacdccd0e403d8152dde5a" dependencies = [ "bytes", - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "dnd", "iced_core", "iced_futures", @@ -3198,7 +3156,7 @@ dependencies = [ "as-raw-xcb-connection", "bitflags 2.11.0", "bytemuck", - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "cryoglyph", "futures", "glam", @@ -3226,7 +3184,7 @@ name = "iced_widget" version = "0.14.2" source = "git+https://github.com/pop-os/libcosmic.git#9602dfd2f12b667e0afacdccd0e403d8152dde5a" dependencies = [ - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "dnd", "iced_renderer", "iced_runtime", @@ -3244,7 +3202,7 @@ name = "iced_winit" version = "0.14.0" source = "git+https://github.com/pop-os/libcosmic.git#9602dfd2f12b667e0afacdccd0e403d8152dde5a" dependencies = [ - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "cursor-icon", "dnd", "iced_debug", @@ -4307,7 +4265,7 @@ dependencies = [ "apply", "ashpd 0.12.3", "auto_enums", - "cosmic-client-toolkit 0.2.0", + "cosmic-client-toolkit", "cosmic-config", "cosmic-freedesktop-icons", "cosmic-settings-config", @@ -4546,11 +4504,10 @@ dependencies = [ [[package]] name = "lzma-rust2" -version = "0.15.7" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1670343e58806300d87950e3401e820b519b9384281bbabfb15e3636689ffd69" +checksum = "47bb1e988e6fb779cf720ad431242d3f03167c1b3f2b1aae7f1a94b2495b36ae" dependencies = [ - "crc", "sha2", ] @@ -9402,9 +9359,9 @@ dependencies = [ [[package]] name = "zip" -version = "7.2.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42e33efc22a0650c311c2ef19115ce232583abbe80850bc8b66509ebef02de0" +checksum = "b680f2a0cd479b4cff6e1233c483fdead418106eae419dc60200ae9850f6d004" dependencies = [ "aes", "bzip2", @@ -9412,8 +9369,7 @@ dependencies = [ "crc32fast", "deflate64", "flate2", - "generic-array", - "getrandom 0.3.4", + "getrandom 0.4.2", "hmac", "indexmap 2.13.0", "lzma-rust2", diff --git a/Cargo.toml b/Cargo.toml index be0b5ff..c19f30d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ rust-version = "1.90" anyhow = "1" chrono = { version = "0.4", features = ["unstable-locales"] } icu = { version = "2.1.1", features = ["compiled_data"] } -cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "d0e95be", optional = true } +cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "160b086", optional = true } cosmic-mime-apps = { git = "https://github.com/pop-os/cosmic-mime-apps.git", optional = true } dirs = "6.0.0" env_logger = "0.11" @@ -36,14 +36,14 @@ tokio = { version = "1", features = ["process", "sync"] } trash = { git = "https://github.com/jackpot51/trash-rs.git", branch = "cosmic" } url = "2.5" walkdir = "2.5.0" -wayland-client = { version = "0.31.12", optional = true } +wayland-client = { version = "0.31.13", optional = true } xdg = { version = "3.0", optional = true } xdg-mime = { git = "https://github.com/ebassi/xdg-mime-rs" } # Compression bzip2 = { version = "0.6", optional = true } #TODO: replace with pure Rust crate flate2 = "1.1" tar = "0.4.44" -lzma-rust2 = { version = "0.15.7", optional = true } +lzma-rust2 = { version = "0.16", optional = true } ordermap = { version = "1.1.0", features = ["serde"] } # Internationalization i18n-embed = { version = "0.16", features = [ @@ -54,7 +54,7 @@ i18n-embed-fl = "0.10" rust-embed = "8" slotmap = "1.1.1" recently-used-xbel = "1.2.0" -zip = "7" +zip = "8" uzers = "0.12.2" md-5 = "0.10.6" png = "0.18" @@ -124,7 +124,7 @@ inherits = "release" debug = true [target.'cfg(unix)'.dependencies] -fork = "0.6" +fork = "0.7" [target.'cfg(target_os = "linux")'.dependencies] procfs = "0.18" diff --git a/src/main.rs b/src/main.rs index d4cb5bd..276cb9b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,5 +6,6 @@ use tikv_jemallocator::Jemalloc; static GLOBAL: Jemalloc = Jemalloc; fn main() -> Result<(), Box> { + let _ = jxl_oxide::integration::register_image_decoding_hook(); cosmic_files::main() } diff --git a/src/tab.rs b/src/tab.rs index d36aff0..6d5cd60 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -2113,55 +2113,26 @@ impl ItemThumbnail { } tried_supported_file = true; - let dyn_img: Option = match mime.subtype().as_str() { - "jxl" => match File::open(path) { - Ok(file) => match JxlDecoder::new(file) { - Ok(mut decoder) => { - let mut limits = image::Limits::default(); - let max_ram = max_mem * 1000 * 1000 / jobs as u64; - limits.max_alloc = Some(max_ram); - let _ = decoder.set_limits(limits); - match image::DynamicImage::from_decoder(decoder) { - Ok(img) => Some(img), - Err(err) => { - log::warn!("failed to decode jxl {}: {}", path.display(), err); - None - } - } - } + let dyn_img = match image::ImageReader::open(path) + .and_then(image::ImageReader::with_guessed_format) + { + Ok(mut reader) => { + let mut limits = image::Limits::default(); + let max_ram = max_mem * 1000 * 1000 / jobs as u64; + limits.max_alloc = Some(max_ram); + reader.limits(limits); + match reader.decode() { + Ok(reader) => Some(reader), Err(err) => { - log::warn!("failed to create jxl decoder {}: {}", path.display(), err); - None - } - }, - Err(err) => { - log::warn!("failed to open path {}: {}", path.display(), err); - None - } - }, - _ => { - match image::ImageReader::open(path) - .and_then(image::ImageReader::with_guessed_format) - { - Ok(mut reader) => { - let mut limits = image::Limits::default(); - let max_ram = max_mem * 1000 * 1000 / jobs as u64; - limits.max_alloc = Some(max_ram); - reader.limits(limits); - match reader.decode() { - Ok(reader) => Some(reader), - Err(err) => { - log::warn!("failed to decode {}: {}", path.display(), err); - None - } - } - } - Err(err) => { - log::warn!("failed to read {}: {}", path.display(), err); + log::warn!("failed to decode {}: {}", path.display(), err); None } } } + Err(err) => { + log::warn!("failed to read {}: {}", path.display(), err); + None + } }; if let Some(dyn_img) = dyn_img {