Image support in general
im-n1 opened this issue · 3 comments
im-n1 commented
There is a project called ranger which has image support.
from readme:
w3m for the w3mimgdisplay program to preview images
Hope it will help you to implement image views.
duynguyenhoang commented
Let me consider it. Thank you for your suggestion
im-n1 commented
im-n1 commented
I was kinda curious so I have advanced a bit. I'm in touch with lead Ranger developer and I asked him for help. This is what he replied:
Hi Pavel,
Image rendering in the terminal is a messy subject and is generally
unstable, but perhaps still worth trying ;)
ranger supports multiple methods for rendering images, w3mimgdisplay is
one of them. Another promising option is the recently started project
"Ueberzug" (https://github.com/seebye/ueberzug)
Both programs are standalone executables that read their commands
through STDIN. The format of the command differs between the programs.
For ueberzug it's a simple JSON object as documented in ueberzug's
README.md file. Should look like this:
echo '{"action": "add", "identifier": "xyz", "x": 0, "y": 0, "path":
"/some/path/some_image.jpg"}' | ueberzug layer
w3mimgdisplay's format is not well documented, last time I checked. You
can get some inspiration on how to use it by checking
https://github.com/ranger/ranger/blob/master/ranger/ext/img_display.py ,
at the very end of the method "_generate_w3m_input". It's some string
starting with "0;1;x-pos,y-pos,width,height,...". Perhaps you can find
the full specifications with some googling.
Good luck with your endeavor,
Roman
I guess we can try to give it a chance. Hm? ;)