gurk-rs icon indicating copy to clipboard operation
gurk-rs copied to clipboard

to consider: preview images and videos via textmode representations

Open herrsimon opened this issue 3 years ago • 5 comments

There are certainly more pressing issues to take care of before considering this one, but it's always good to have things on the horizon:

Nowadays it is possible to convert images and even videos in surprisingly good quality for viewing in a terminal. This should be taken advantage of in order to optionally include previews of attachments in the message section (for videos, one should just show a single frame as a picture).

As a side effect, this feature would certainly attract lots of new users (whether that's good or bad is up to you to decide).

herrsimon avatar Jun 23 '22 22:06 herrsimon

An integration of ueberzug is also worth considering for image previews since it can render them in full quality inside the terminal.

lacamar avatar Jul 26 '22 16:07 lacamar

ueberzugpp would be fantastic

kajdo avatar Sep 04 '24 21:09 kajdo

NB: ueberzug has a new home: ueberzug. The above linked repo is archived.

Would propose ratatui-image as an alternative to that, as this project already uses ratatui, and ratatui-image has sixel support with fallback for terminals that don't support sixel.

jmetz avatar Sep 08 '24 14:09 jmetz

I've added a WIP minimal example of showing an image in a popup here: https://github.com/jmetz/gurk-rs/tree/feat/image-embedding Note that you'll need this image in the project root for it to work at the moment, as I haven't fully familiarised myself with gurk's internals: awkward_monkey_look

If I have time I'll look into creating thumbnails in the messages list, as well as showing a popup when an image is selected, but more than happy for someone else who knows what they're doing to jump in at this point :sweat_smile:

jmetz avatar Sep 08 '24 15:09 jmetz

I've added a WIP minimal example of showing an image

Neat!

I believe you should try to plug your patch next to https://github.com/boxdot/gurk-rs/blob/6589bc0e5e123f2cfa1fdfabc0592676d8f2d530/src/ui/draw.rs#L488 which prepares the ratatui ListItem. You'll have to figure out how to integrate it in there, though, I've never done it myself.

gferon avatar Sep 08 '24 20:09 gferon