Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.

How to preview images/pictures/photos/graphics using (w3mimgdisplay)?

0 votes
asked Sep 24, 2015 in vifm by anonymous

The Vifm v0.8 changelog mention new features, including the :

[a]bility to use terminal applications to preview graphics (e.g. w3mimgdisplay).

Unfortunately, I do not see it mentioned anywhere in the documentation and I am not sure how to set it up.

It's worth noting that ranger supports displaying full color images on *NIX and even on OS X (iTerm).

2 Answers

0 votes
answered Sep 24, 2015 by deleted-00
reshown Aug 30 by xaizek
0 votes
answered Sep 24, 2015 by xaizek

Unfortunately, I do not see it mentioned anywhere in the documentation and I am not sure how to set it up.

This is because it has been made possible and Vifm now provides means to achieve it, but that's where support ends, i.e. nothing is hard-coded and theoretically any similar application might work by using these means.

There is related Wiki page describing possible setup with w3mimgdisplay: How to preview images.

It's worth noting that ranger supports displaying full color images on *NIX and even on OS X (iTerm).

As far as I know it also uses w3mimgdisplay, although not sure about OS X.

In case of ranger it is more hard-coded and thus somewhat more convenient to users, but not very good from design point of view (unfortunately, what's good for application sometimes leads to worse user experience, but I think consistency of application should be preserved, unless there are strong reasons to break it).

commented Sep 24, 2015 by anonymous

As far as I know, w3mimgdisplay does not work on OS X: I have failed trying to compile it many times before. By the way, I also strongly oppose hard coding unless absolutely necessary, but it would be interesting to implement full color image preview for OS X too. Ideally, this should be provided by an external command that is more polished, cross-platform, and less "patchy" than w3mimgdisplay.

commented Sep 24, 2015 by xaizek

Ideally, this should be provided by an external command that is more polished, cross-platform, and less "patchy" than w3mimgdisplay.

Yeah, but terminal emulators are text only and know nothing about pictures, so having it cross-platform or even cross-terminal is basically impossible without substantial changes to the way they all work (an extension that would take path to image and coordinates/dimensions would probably do it, but this needs changes to all terminals out there).

commented Sep 25, 2015 by anonymous

What about hiptext? Technically it's text, it's multi-platform, and it's simpler. Looks like a good compromise to me.

commented Sep 25, 2015 by xaizek

I didn't try hiptext, tried other similar viewers and they might not always work depending on what controlling sequences they use. If they don't just output characters sequentially and, say, change position of output you need quite a lot of processing to make it work inside applications (read it as "you need to do terminal emulator's work"). At least ncurses doesn't let you output escape sequences as is, one needs to translate them into corresponding curses API calls.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...