yazi: previews for `image/{heic,jxl,svg+xml}` mime with `magick` not working
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
kitty 0.34.1
Did you try the latest code to see if this problem got fixed?
Tried, but the problem still
yazi --debug output
Yazi
Version: 0.2.5 (9a5b756 2024-06-25)
Debug : false
OS : linux-x86_64 (unix)
Ya
Version: 0.2.5
Emulator
Emulator.via_env: ("xterm-kitty", "")
Emulator.via_csi: Ok(Kitty)
Emulator.detect : Kitty
Adapter
Adapter.matches: Kitty
Desktop
XDG_SESSION_TYPE: Some("tty")
WAYLAND_DISPLAY : None
DISPLAY : Some(":1")
SSH
shared.in_ssh_connection: false
WSL
/proc/sys/fs/binfmt_misc/WSLInterop: false
Variables
SHELL : Some("/bin/zsh")
EDITOR : Some("nvim")
ZELLIJ_SESSION_NAME: None
YAZI_FILE_ONE : None
YAZI_CONFIG_HOME : None
Text Opener
default: Some(Opener { run: "${EDITOR} \"$@\"", block: true, orphan: false, desc: "Neovim", for_: None, spread: true })
block : Some(Opener { run: "${EDITOR} \"$@\"", block: true, orphan: false, desc: "Neovim", for_: None, spread: true })
tmux
TMUX : false
Version: No such file or directory (os error 2)
Dependencies
file : 5.45
ueberzugpp : No such file or directory (os error 2)
ffmpegthumbnailer: 2.2.2
magick : 7.1.1-25
fzf : 0.53.0
fd : 9.0.0
rg : 14.1.0
chafa : No such file or directory (os error 2)
zoxide : 0.9.4
unar : No such file or directory (os error 2)
jq : 1.7.1
Describe the bug
I can open image/{heic,jxl,svg+xml} files just fine with either <Enter> or <o> but previews with magick fail with the following error for each image:
~/.local/state/yazi/yazi.log
ERROR yazi_scheduler::preload::prework: Preload task `magick` returned 2
at yazi-scheduler/src/preload/prework.rs:62
Expected Behavior
Previews for image/{heic,jxl,svg+xml} are working
To Reproduce
- Open
yaziin a directory withimage/{heic,jxl,svg+xml}files - Highlight said files
- Preview isn’t working for any of them
- The error mentioned is written to
~/.local/state/yazi/yazi.logfor each image
Configuration
[preview]
tab_size = 2
max_width = 600
max_height = 900
cache_dir = ""
image_filter = "triangle"
image_quality = 75
sixel_fraction = 15
[opener]
open = [{ run = 'xdg-open "$@"', desc = "Open" }]
[open]
rules = [
{ mime = "image/*", use = [
"open",
"reveal",
] },
]
[plugin]
preloaders = [
{ mime = "image/{heic,jxl,svg+xml}", run = "magick" },
]
Anything else?
Converting some image/{heic,jxl,svg+xml} files directly with magick from the terminal works fine, re-using the args used in
https://github.com/sxyazi/yazi/blob/9a5b75662a4de9ed9ba2a6c949fbd5445b841096/yazi-plugin/preset/plugins/magick.lua#L23-L31
% magick --version
Version: ImageMagick 7.1.1-25 Q16 x86_64 21883 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib cairo freetype heic jng jpeg jxl lcms ltdl pangocairo png rsvg tiff webp x xml zlib zstd
Compiler: gcc (13.2)
% file -bL --mime-type "sample.heic" "sample.jxl" "sample.svg"
image/heic
image/jxl
image/svg+xml
% magick "sample.heic" -density 200 -resize 600x900 -quality 75 -verbose "/tmp/yazi/sample.jpg"
sample.heic=>/tmp/yazi/sample.jpg HEIC 640x426=>600x399 600x399+0+0 8-bit sRGB 38638B 0.010u 0:00.003
% magick "sample.jxl" -density 200 -resize 600x900 -quality 75 -verbose "/tmp/yazi/sample.jpg"
sample.jxl=>/tmp/yazi/sample.jpg JXL 1800x800=>600x267 600x267+0+0 10-bit sRGB 11102B 0.010u 0:00.002
% magick "sample.svg" -density 200 -resize 600x900 -quality 75 -verbose "/tmp/yazi/sample.jpg"
sample.svg=>/tmp/yazi/sample.jpg SVG 64x64=>600x600 600x600+0+0 16-bit sRGB 14380B 0.030u 0:00.004
The /tmp/sample.jpg files can be opened/previewed just fine after the conversion.
Other images file types previews are working fine with image.lua plugin.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Should be fixed in https://github.com/sxyazi/yazi/pull/1213, please give it a try!
Thanks for the info, helped a lot!
This might be due to differences in
magickversions - I’ll look into it.This also fails in the terminal:
But this works:
Maybe inverting the order in
magick.luawould work (input/parameters/output instead of parameters/input/output)?No, it doesn’t:
No, only
argsis needed, i.e.: