diff --git a/Cargo.lock b/Cargo.lock index b10554c11..51b81615f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -692,9 +692,9 @@ dependencies = [ [[package]] name = "image" -version = "0.23.11" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f0a8345b33b082aedec2f4d7d4a926b845cee184cbe78b703413066564431b" +checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" dependencies = [ "bytemuck", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index 27ba0f284..0b48bc7ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ askalono = "0.4.3" bytecount = "0.6.0" clap = "2.33.3" strum = { version = "0.19.5", features = ["derive"] } -image = "0.23.11" +image = "0.23.12" regex = "1" error-chain = "0.12" toml = "0.5.7" diff --git a/src/onefetch/image_backends/kitty.rs b/src/onefetch/image_backends/kitty.rs index 9a24cfbcc..775e2131f 100644 --- a/src/onefetch/image_backends/kitty.rs +++ b/src/onefetch/image_backends/kitty.rs @@ -98,7 +98,7 @@ impl super::ImageBackend for KittyBackend { let image_rows = height_ratio * f64::from(image.height()); // convert the image to rgba samples - let rgba_image = image.to_rgba(); + let rgba_image = image.to_rgba8(); let flat_samples = rgba_image.as_flat_samples(); let raw_image = flat_samples.image_slice().expect("Conversion from image to rgba samples failed"); diff --git a/src/onefetch/image_backends/mod.rs b/src/onefetch/image_backends/mod.rs index ef0fed95d..fcc6a9a8c 100644 --- a/src/onefetch/image_backends/mod.rs +++ b/src/onefetch/image_backends/mod.rs @@ -14,12 +14,12 @@ pub trait ImageBackend { #[cfg(not(windows))] pub fn get_best_backend() -> Option> { - if kitty::KittyBackend::supported() { + if sixel::SixelBackend::supported() { + Some(Box::new(sixel::SixelBackend::new())) + } else if kitty::KittyBackend::supported() { Some(Box::new(kitty::KittyBackend::new())) } else if iterm::ITermBackend::supported() { Some(Box::new(iterm::ITermBackend::new())) - } else if sixel::SixelBackend::supported() { - Some(Box::new(sixel::SixelBackend::new())) } else { None } diff --git a/src/onefetch/image_backends/sixel.rs b/src/onefetch/image_backends/sixel.rs index 592ffff5d..a9f05e074 100644 --- a/src/onefetch/image_backends/sixel.rs +++ b/src/onefetch/image_backends/sixel.rs @@ -91,7 +91,7 @@ impl super::ImageBackend for SixelBackend { let image_columns = width_ratio * image.width() as f64; let image_rows = height_ratio * image.height() as f64; - let rgba_image = image.to_rgba(); // convert the image to rgba samples + let rgba_image = image.to_rgba8(); // convert the image to rgba samples let flat_samples = rgba_image.as_flat_samples(); let mut rgba_image = rgba_image.clone(); // reduce the amount of colors using dithering