Skip to content
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

Image support in general #80

Open
im-n1 opened this issue Aug 23, 2018 · 3 comments
Open

Image support in general #80

im-n1 opened this issue Aug 23, 2018 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@im-n1
Copy link

im-n1 commented Aug 23, 2018

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
Copy link
Collaborator

Let me consider it. Thank you for your suggestion

@im-n1
Copy link
Author

im-n1 commented Aug 24, 2018

Here is an example:

image

@duynguyenhoang duynguyenhoang added help wanted Extra attention is needed enhancement New feature or request labels Aug 28, 2018
@im-n1
Copy link
Author

im-n1 commented Nov 27, 2018

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? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants