File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed
src/onefetch/image_backends Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ askalono = "0.4.3"
2828bytecount = " 0.6.0"
2929clap = " 2.33.3"
3030strum = { version = " 0.19.5" , features = [" derive" ] }
31- image = " 0.23.11 "
31+ image = " 0.23.12 "
3232regex = " 1"
3333error-chain = " 0.12"
3434toml = " 0.5.7"
Original file line number Diff line number Diff 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" ) ;
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ pub trait ImageBackend {
1414
1515#[ cfg( not( windows) ) ]
1616pub 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments