Skip to content

Commit ed1359c

Browse files
Merge pull request #318 from o2sh/dependabot/cargo/image-0.23.12
2 parents 43e540f + 8b3cd82 commit ed1359c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ askalono = "0.4.3"
2828
bytecount = "0.6.0"
2929
clap = "2.33.3"
3030
strum = { version = "0.19.5", features = ["derive"] }
31-
image = "0.23.11"
31+
image = "0.23.12"
3232
regex = "1"
3333
error-chain = "0.12"
3434
toml = "0.5.7"

src/onefetch/image_backends/kitty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl super::ImageBackend for KittyBackend {
9898
let image_rows = height_ratio * f64::from(image.height());
9999

100100
// convert the image to rgba samples
101-
let rgba_image = image.to_rgba();
101+
let rgba_image = image.to_rgba8();
102102
let flat_samples = rgba_image.as_flat_samples();
103103
let raw_image =
104104
flat_samples.image_slice().expect("Conversion from image to rgba samples failed");

src/onefetch/image_backends/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ pub trait ImageBackend {
1414

1515
#[cfg(not(windows))]
1616
pub fn get_best_backend() -> Option<Box<dyn ImageBackend>> {
17-
if kitty::KittyBackend::supported() {
17+
if sixel::SixelBackend::supported() {
18+
Some(Box::new(sixel::SixelBackend::new()))
19+
} else if kitty::KittyBackend::supported() {
1820
Some(Box::new(kitty::KittyBackend::new()))
1921
} else if iterm::ITermBackend::supported() {
2022
Some(Box::new(iterm::ITermBackend::new()))
21-
} else if sixel::SixelBackend::supported() {
22-
Some(Box::new(sixel::SixelBackend::new()))
2323
} else {
2424
None
2525
}

src/onefetch/image_backends/sixel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl super::ImageBackend for SixelBackend {
9191
let image_columns = width_ratio * image.width() as f64;
9292
let image_rows = height_ratio * image.height() as f64;
9393

94-
let rgba_image = image.to_rgba(); // convert the image to rgba samples
94+
let rgba_image = image.to_rgba8(); // convert the image to rgba samples
9595
let flat_samples = rgba_image.as_flat_samples();
9696
let mut rgba_image = rgba_image.clone();
9797
// reduce the amount of colors using dithering

0 commit comments

Comments
 (0)