File tree 5 files changed +8
-8
lines changed
src/onefetch/image_backends
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"
28
28
bytecount = " 0.6.0"
29
29
clap = " 2.33.3"
30
30
strum = { version = " 0.19.5" , features = [" derive" ] }
31
- image = " 0.23.11 "
31
+ image = " 0.23.12 "
32
32
regex = " 1"
33
33
error-chain = " 0.12"
34
34
toml = " 0.5.7"
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ impl super::ImageBackend for KittyBackend {
98
98
let image_rows = height_ratio * f64:: from ( image. height ( ) ) ;
99
99
100
100
// convert the image to rgba samples
101
- let rgba_image = image. to_rgba ( ) ;
101
+ let rgba_image = image. to_rgba8 ( ) ;
102
102
let flat_samples = rgba_image. as_flat_samples ( ) ;
103
103
let raw_image =
104
104
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 {
14
14
15
15
#[ cfg( not( windows) ) ]
16
16
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 ( ) {
18
20
Some ( Box :: new ( kitty:: KittyBackend :: new ( ) ) )
19
21
} else if iterm:: ITermBackend :: supported ( ) {
20
22
Some ( Box :: new ( iterm:: ITermBackend :: new ( ) ) )
21
- } else if sixel:: SixelBackend :: supported ( ) {
22
- Some ( Box :: new ( sixel:: SixelBackend :: new ( ) ) )
23
23
} else {
24
24
None
25
25
}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ impl super::ImageBackend for SixelBackend {
91
91
let image_columns = width_ratio * image. width ( ) as f64 ;
92
92
let image_rows = height_ratio * image. height ( ) as f64 ;
93
93
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
95
95
let flat_samples = rgba_image. as_flat_samples ( ) ;
96
96
let mut rgba_image = rgba_image. clone ( ) ;
97
97
// reduce the amount of colors using dithering
You can’t perform that action at this time.
0 commit comments