-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline display of images #1301
Comments
I'm available to help if needed. Note that Chafa can be made to generate Unicode, ASCII or sixel output using the same API. There isn't a lot of extra work to get sixel output that way, even the dimensions are still specified in character cells. Also, if you need extra API (for instance, ways to access canvas contents), feel free to let me know. I'm already planning to add more accessors/drawing functions, but I haven't planned out the details yet, so input is very welcome. |
First tests with libchafa for displaying pictures inline. We choose to use ASCII art for now. Reason is that the regular method uses color escape codes and ncurses will just print those codes and not use the colors. Regards #1301
@mdosch @wstrm Displaying each image inline? Sounds like you can be spammed easily. So should we do it like How do we detect whether an URL actually is just an image? We would need to download it first I assume since just the file ending won't be a guarantee. |
Afaik conversations automatically downloads from contacts in your roster if the file size is below a configurable threshold. |
First tests with libchafa for displaying pictures inline. We choose to use ASCII art for now. Reason is that the regular method uses color escape codes and ncurses will just print those codes and not use the colors. Regards #1301
We could use @hpjansson s chafa/libchafa to display images inline.
Expected Behavior
There should be a dedicated setting for this. For example
/inlineimage on|off
.When
on
and a user sends a URL ending in a known image format (we will have to search through each incoming message).We download the image to a temporary location (or a general media location) and use chafa to display the picture inside Profanity.
Similar this could be done for avatars, a new
/avatar view contact
could be added.Current Behavior
The URL is shown.
Possible Solution
Chafa has also sixel support. I'm not sure whether we can detect whether a terminal supports this or should make it easy and just let the user have a setting for this.
So in case sixel support is present/set we can use sixel to display the image, otherwise we use one of chafas tricks.
See https://hpjansson.org/chafa/gallery/ what chafa looks like on the terminal.
It might be helpful to look at what vifm and ranger do:
vifm/vifm@7e21fa6
ranger/ranger#1434
Example what it looks like in ranger:
The text was updated successfully, but these errors were encountered: