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

"Failed to execute w3mimgdisplay, []" but only on JPEGs #1170

Closed
b33rcity opened this issue May 14, 2018 · 7 comments
Closed

"Failed to execute w3mimgdisplay, []" but only on JPEGs #1170

b33rcity opened this issue May 14, 2018 · 7 comments

Comments

@b33rcity
Copy link

Runtime Environment

ranger-stable 1.8.1
Python 3.5.5 (default, May 13 2018, 20:10:32)
[GCC 6.4.0]
Termite, Gentoo, awesomwm

Current Behavior

I can preview png files in Termite with the w3m method without a problem. JPEG files consistently return the error in the title and refuse to display. This also affects PDF files, regardless of whether I use pdftoppm or pdftotext. This issue was present with my config files from the ebuild I installed on 2018-04-08 and persisted after I updated the ebuilt and re-copied the config files.

Expected Behavior

JPEG (and PDF) should display as PNGs do.

Steps to reproduce

  1. Install ebuild from Portage of: Ranger, Python3.5, and w3m; compile Termite and vte-ng from github source
  2. Set preview_images=true and method to w3m
  3. Attempt to view PNG and JPEG images

Traceback

Failed to execute w3mimgdisplay, []
@toonn
Copy link
Member

toonn commented May 14, 2018

Does w3migmdisplay work for you from the command line?

@b33rcity
Copy link
Author

b33rcity commented May 14, 2018

I can call w3m /path/to/image.jpg, but w3mimgdisplay /path/to/image.jpg does nothing; echo $? returns a 1.

EDIT:

After a little research I learned that w3mimgdisplay can't be called that way. https://www.mail-archive.com/mutt-users@mutt.org/msg34445.html has the details.

So following that format (and correcting a typo), I can verify that, yes, w3mimgdisplay will display a png image (for an instant as the terminal redraws over the image when it scrolls), but will not display a jpg from the command line.

I guess this makes it a w3m issue, and not a ranger issue :p

@toonn
Copy link
Member

toonn commented May 14, 2018

It's probably termite. w3mimgdisplay is made with xterm in mind and termite's too different.

@b33rcity
Copy link
Author

I installed an ebuild of xterm just now and found the same issue. Ranger shows the png but not the jpg. I'll research w3mimgdisplay a bit more. It's possible I missed something in the w3m ebuild (I have all the USE flags listed in the Portage docs for w3m, but you never know with Gentoo).

@b33rcity
Copy link
Author

Quick update:

I tried installing w3m from source on Arch and termite from pacman. Image previews using w3m worked flawlessly following this procedure.

Optimistic, I tried unmerging w3m on my Gentoo box and reinstalling it from source only to run into the exact same issue. This may be a peculiarity of Gentoo (big fricken' surprise).

@b33rcity
Copy link
Author

b33rcity commented Jun 4, 2018

Thanks to some help on the Gentoo Forums, I was able to find a solution to this problem.

The issue wasn't with ranger or even with w3m, but with a dependency of w3m. In my case, imlib2 was not compiled with jpeg support. I'm not sure how that happened, but once I found the problem it was a simple matter of running emerge -N on that package.

Termite is now happily playing with w3m in Ranger--and it's even transparent and supports Powerline fonts!

@b33rcity b33rcity closed this as completed Jun 4, 2018
@toonn
Copy link
Member

toonn commented Jun 5, 2018

Ah, great! Definitely something I'd never consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants