sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.05k stars 373 forks source link

yazi crashes on special TIFF file #1717

Closed vosskaem closed 3 weeks ago

vosskaem commented 3 weeks ago

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

xfce4-terminal 1.1.3-2

yazi --debug output

yazi --debug

Yazi
    Version: 0.3.3 (e1773b1 2024-10-02)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (e1773b1 2024-10-02)

Emulator
    Emulator.via_env: ("xterm-256color", "")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect : Unknown([])

Adapter
    Adapter.matches: X11

Desktop
    XDG_SESSION_TYPE           : Some("x11")
    WAYLAND_DISPLAY            : None
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/bin/bash")
    EDITOR             : Some("vim")
    VISUAL             : Some("vim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : 3.5
    ZELLIJ_SESSION_NAME: None
    Zellij 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.3
    magick           : 7.1.1-38
    fzf              : 0.55.0
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : No such file or directory (os error 2)
    zoxide           : 0.9.6
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1

--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/vosskaem/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

Either open yazi in a directory where a special tiff file resides or try to change into a directory, where this file resides, crashes yazi.

The file is an satellite image with file type:

file Alpsee_bis_Baeunlings.png.ovr 
Alpsee_bis_Baeunlings.png.ovr: TIFF image data, little-endian, direntries=13, height=475, bps=170, compression=none, PhotometricInterpretation=RGB, width=927

The file is viewable with feh, Evince and Xreader (showing all sub images in different sizes)

Minimal reproducer

Create a directory, and put a file of the obove described filetype inside. Go inside that directory and open yazi.

The result is

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
  source slice length (440325) does not match destination slice length (1320975)
in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.2/src/codecs/tiff.rs, line 247
thread: tokio-runtime-worker

If needed I can provide the file. Size is 2.2 MB

Anything else?

No response

sxyazi commented 3 weeks ago

If needed I can provide the file

Yeah, please upload the file for me to test

vosskaem commented 3 weeks ago

Alpsee_bis_Baeunlings.png.ovr.zip

sxyazi commented 3 weeks ago

I can confirm it's a bug in the image library used by Yazi, https://github.com/image-rs/image/issues/2179

We need to wait for the upstream fix. In the meantime, I'll create a PR to temporarily disable it.

vosskaem commented 3 weeks ago

Just for interest: How do you track to enable TIFF decoding again when it is fixed upstream if you close this bug?

sxyazi commented 3 weeks ago

I subscribed to the upstream issue

vosskaem commented 3 weeks ago

I now installed the new nightly and the funny thing is that this file now has a preview!