Skip to content

Commit 0b340b6

Browse files
authored
fix: failed to parse certain image dimensions for Überzug++ backend (#2020)
1 parent 7498b97 commit 0b340b6

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ crossterm = { version = "0.28.1", features = [ "event-stream" ] }
1919
dirs = "5.0.1"
2020
futures = "0.3.31"
2121
globset = "0.4.15"
22-
libc = "0.2.167"
22+
libc = "0.2.168"
2323
md-5 = "0.10.6"
2424
mlua = { version = "0.10.2", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
2525
parking_lot = "0.12.3"

yazi-adapter/src/drivers/ueberzug.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{path::{Path, PathBuf}, process::Stdio};
22

33
use anyhow::{Result, bail};
4+
use image::ImageReader;
45
use ratatui::layout::Rect;
56
use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}};
67
use tracing::{debug, warn};
@@ -47,7 +48,10 @@ impl Ueberzug {
4748
};
4849

4950
let p = path.to_owned();
50-
let (w, h) = tokio::task::spawn_blocking(move || image::image_dimensions(p)).await??;
51+
let (w, h) = tokio::task::spawn_blocking(move || {
52+
ImageReader::open(p)?.with_guessed_format()?.into_dimensions()
53+
})
54+
.await??;
5155

5256
let area = Dimension::ratio()
5357
.map(|(r1, r2)| Rect {

yazi-config/preset/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ These files are already included with Yazi when you install the release, so you
1414

1515
However, if you want to customize certain configurations:
1616

17-
- Create a `yazi.toml` in your config directory to override the settings in [`yazi-default.toml`][yazi-default], so either:
17+
- Create a `yazi.toml` in your config directory to override certain settings in [`yazi-default.toml`][yazi-default], so either:
1818
- `~/.config/yazi/yazi.toml` on Unix-like systems
1919
- `C:\Users\USERNAME\AppData\Roaming\yazi\config\yazi.toml` on Windows
20-
- Create a `keymap.toml` in your config directory to override the settings in [`keymap-default.toml`][keymap-default], so either:
20+
- Create a `keymap.toml` in your config directory to override certain settings in [`keymap-default.toml`][keymap-default], so either:
2121
- `~/.config/yazi/keymap.toml` on Unix-like systems
2222
- `C:\Users\USERNAME\AppData\Roaming\yazi\config\keymap.toml` on Windows
23-
- Create a `theme.toml` in your config directory to override the settings in [`theme-light.toml`][theme-light] and [`theme-dark.toml`][theme-dark], so either:
23+
- Create a `theme.toml` in your config directory to override certain settings in [`theme-light.toml`][theme-light] and [`theme-dark.toml`][theme-dark], so either:
2424
- `~/.config/yazi/theme.toml` on Unix-like systems
2525
- `C:\Users\USERNAME\AppData\Roaming\yazi\config\theme.toml` on Windows
2626

0 commit comments

Comments
 (0)