From 6b009942b7eaaca91bc97c53a48230e3f63930fd Mon Sep 17 00:00:00 2001 From: Alice Carroll Date: Mon, 28 Oct 2024 14:32:46 +0300 Subject: [PATCH] chore: bump `viuer` to `0.9.1` --- Cargo.lock | 240 +++++++++++++++++++++++++++++++++------- Cargo.toml | 6 +- src/algorithm/encode.rs | 20 ++-- 3 files changed, 211 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2cc2306ee..027d23b12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -127,19 +127,18 @@ checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arboard" -version = "3.3.2" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2041f1943049c7978768d84e6d0fd95de98b76d6c4727b09e78ec253d29fa58" +checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", "core-graphics 0.23.1", - "image", + "image 0.25.4", "log", - "objc", - "objc-foundation", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", "parking_lot", - "thiserror", "windows-sys 0.48.0", "x11rb", ] @@ -349,6 +348,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "bumpalo" version = "3.15.4" @@ -381,6 +389,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.6.0" @@ -545,9 +559,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clipboard-win" -version = "5.3.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d517d4b86184dbb111d3556a10f1c8a04da7428d2987bf1081602bf11c3aa9ee" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ "error-code", ] @@ -956,6 +970,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "crossterm" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +dependencies = [ + "bitflags 2.5.0", + "crossterm_winapi", + "parking_lot", + "rustix", + "winapi", +] + [[package]] name = "crossterm_winapi" version = "0.9.1" @@ -1758,6 +1785,35 @@ dependencies = [ "tiff", ] +[[package]] +name = "image" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc144d44a31d753b02ce64093d532f55ff8dc4ebf2ffb8a63c0dda691385acae" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "gif", + "image-webp", + "num-traits", + "png", + "qoi", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e031e8e3d94711a9ccb5d6ea357439ef3dcbed361798bd4071dc4d9793fbe22f" +dependencies = [ + "byteorder-lite", + "quick-error", +] + [[package]] name = "indexmap" version = "2.2.6" @@ -1917,9 +1973,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -2121,9 +2177,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libffi" @@ -2184,9 +2240,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -2541,32 +2597,111 @@ dependencies = [ ] [[package]] -name = "objc-foundation" -version = "0.1.1" +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ - "block", - "objc", - "objc_id", + "objc-sys", + "objc2-encode", ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-app-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "cc", + "bitflags 2.5.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] -name = "objc_id" -version = "0.1.1" +name = "objc2-core-data" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "objc", + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.5.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.5.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", ] [[package]] @@ -2914,6 +3049,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.31.0" @@ -3153,9 +3294,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.5.0", "errno", @@ -3527,7 +3668,7 @@ dependencies = [ "enum-iterator", "getrandom", "hound", - "image", + "image 0.24.9", "js-sys", "leptos", "leptos_meta", @@ -3727,7 +3868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2ecb7b6ab8a3eeff2b61770d313d1e971f184e29321785c62ef523b132437b7" dependencies = [ "coolor", - "crossterm", + "crossterm 0.27.0", "thiserror", "xterm-query", ] @@ -4098,7 +4239,7 @@ dependencies = [ "hound", "httparse", "icy_sixel", - "image", + "image 0.25.4", "indexmap", "js-sys", "json5", @@ -4149,7 +4290,7 @@ dependencies = [ "base64 0.22.0", "console_error_panic_hook", "hound", - "image", + "image 0.24.9", "js-sys", "leptos", "leptos_router", @@ -4170,7 +4311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "108094ce120c3d49f6b9543fccd2e8ec4bea9578e9d2932630f3658784b89cc4" dependencies = [ "flume 0.10.14", - "image", + "image 0.24.9", "paste", "thiserror", "uiua-nokhwa-bindings-linux", @@ -4225,7 +4366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216cc5abada227b419490dce787c43f8ca34c3f6bec708414a06cdf8ab88f926" dependencies = [ "bytes", - "image", + "image 0.24.9", "mozjpeg", "thiserror", ] @@ -4384,15 +4525,15 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "viuer" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2ede5c8814363f92f862892dfe71a266f6816b649ca435aed1ff5e2cf3454e" +checksum = "d3f25eeadaacb5253b24f4b576fecad471b07107e552e2a631a6d7ab5e1e49e0" dependencies = [ "ansi_colours", - "base64 0.21.7", + "base64 0.22.0", "console", - "crossterm", - "image", + "crossterm 0.28.1", + "image 0.25.4", "lazy_static", "tempfile", "termcolor", @@ -4947,6 +5088,12 @@ dependencies = [ "flate2", ] +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -4955,3 +5102,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +dependencies = [ + "zune-core", +] diff --git a/Cargo.toml b/Cargo.toml index 2b3c8b5ee..84f1beee0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ rustls = {version = "0.23.2", optional = true, default-features = false, feature ]} terminal_size = {version = "0.3.0", optional = true} trash = {version = "4.0.0", optional = true} -viuer = {version = "0.7.1", optional = true} +viuer = {version = "0.9.1", optional = true} webpki-roots = {version = "0.26.0", optional = true} # Native audio dependencies @@ -68,14 +68,14 @@ tower-lsp = {version = "0.20.0", optional = true, features = ["proposed"]} serde_yaml = {version = "0.9.33", optional = true} # Feature dependencies -arboard = {version = "3", optional = true} +arboard = {version = "3.4.1", optional = true} calamine = {version = "0.24.0", optional = true} color_quant = {version = "1.1", optional = true} cosmic-text = {version = "0.12.1", optional = true} csv = {version = "1", optional = true} gif = {version = "0.13.1", optional = true} hound = {version = "3", optional = true} -image = {version = "0.24.9", optional = true, default-features = false, features = ["bmp", "gif", "ico", "jpeg", "png", "qoi", "webp"]} +image = {version = "0.25.4", optional = true, default-features = false, features = ["bmp", "gif", "ico", "jpeg", "png", "qoi", "webp"]} json5 = {version = "0.4.1", optional = true} libffi = {version = "3", optional = true} libloading = {version = "0.8.3", optional = true} diff --git a/src/algorithm/encode.rs b/src/algorithm/encode.rs index 3b2ef0c74..abc0836e9 100644 --- a/src/algorithm/encode.rs +++ b/src/algorithm/encode.rs @@ -3,7 +3,7 @@ #[cfg(feature = "audio_encode")] use hound::{SampleFormat, WavReader, WavSpec, WavWriter}; #[cfg(feature = "image")] -use image::{DynamicImage, ImageOutputFormat}; +use image::{DynamicImage, ImageFormat}; #[allow(unused_imports)] use crate::{Array, Uiua, UiuaResult, Value}; @@ -16,13 +16,13 @@ pub(crate) fn image_encode(env: &mut Uiua) -> UiuaResult { .as_string(env, "Image format must be a string")?; let value = env.pop(2)?; let output_format = match format.as_str() { - "jpg" | "jpeg" => ImageOutputFormat::Jpeg(100), - "png" => ImageOutputFormat::Png, - "bmp" => ImageOutputFormat::Bmp, - "gif" => ImageOutputFormat::Gif, - "ico" => ImageOutputFormat::Ico, - "qoi" => ImageOutputFormat::Qoi, - "webp" => ImageOutputFormat::WebP, + "jpg" | "jpeg" => ImageFormat::Jpeg, + "png" => ImageFormat::Png, + "bmp" => ImageFormat::Bmp, + "gif" => ImageFormat::Gif, + "ico" => ImageFormat::Ico, + "qoi" => ImageFormat::Qoi, + "webp" => ImageFormat::WebP, format => return Err(env.error(format!("Invalid image format: {}", format))), }; let bytes = @@ -168,7 +168,7 @@ pub(crate) fn audio_decode(env: &mut Uiua) -> UiuaResult { #[doc(hidden)] #[cfg(feature = "image")] -pub fn value_to_image_bytes(value: &Value, format: ImageOutputFormat) -> Result, String> { +pub fn value_to_image_bytes(value: &Value, format: ImageFormat) -> Result, String> { image_to_bytes(&value_to_image(value)?, format) } @@ -208,7 +208,7 @@ pub fn image_bytes_to_array(bytes: &[u8], alpha: bool) -> Result, Str #[doc(hidden)] #[cfg(feature = "image")] -pub fn image_to_bytes(image: &DynamicImage, format: ImageOutputFormat) -> Result, String> { +pub fn image_to_bytes(image: &DynamicImage, format: ImageFormat) -> Result, String> { let mut bytes = std::io::Cursor::new(Vec::new()); image .write_to(&mut bytes, format)