gurk-rs
gurk-rs copied to clipboard
to consider: preview images and videos via textmode representations
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).
An integration of ueberzug is also worth considering for image previews since it can render them in full quality inside the terminal.
ueberzugpp would be fantastic
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.
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:
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:
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.