sxyazi / yazi

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

Gif support? #1195

Open JustinBacher opened 5 days ago

JustinBacher commented 5 days ago

Please describe the problem you're trying to solve

I see on that this has not yet been requested. Is this planned? Is this something you're hoping someone would implement in a PR?

I could see about getting this working although I don't have a clue where to start if I could get a nudge in the right direction.

Would you be willing to contribute this feature?

Describe the solution you'd like

Be able to have gif's/movies/animated images work in previewer

Additional context

No response

Xerxes-2 commented 4 days ago

You may look into function downscale in yazi-adapter/src/image.rs, and each terminal's own implement in yazi-adapter/src/. But it will need quite a few changes because now yazi use image's DynamicImage struct to process image, and DynamicImage seems not support animated image.

sxyazi commented 1 day ago

Yeah I would like to give it a try sometime in the future to see if there's an efficient way to achieve it, it's not a priority for me, but I always welcome any constructive PRs.

Displaying GIFs in the terminal isn't an easy task; we need to consider support for different protocols (AFAIK, kitty and iTerm2 support GIFs, but Sixel doesn't, so we might need to manually split frames for images). There could also be performance problems with how to preload GIF files.