Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/onefetch/image_backends/kitty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions src/onefetch/image_backends/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ pub trait ImageBackend {

#[cfg(not(windows))]
pub fn get_best_backend() -> Option<Box<dyn ImageBackend>> {
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
}
Expand Down
2 changes: 1 addition & 1 deletion src/onefetch/image_backends/sixel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down