Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
w3mimgdisplay doesn't work on jpeg
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
cantcsharp
n00b
n00b


Joined: 22 May 2018
Posts: 4

PostPosted: Tue May 22, 2018 2:17 am    Post subject: w3mimgdisplay doesn't work on jpeg Reply with quote

As is the trend these days, I've installed Ranger and have been trying to get it to do image previews for me (because why else get ranger?)

I originally had used urxvt as my main terminal, and used the urxvt method for image previews, which relies on pixbuf and urxvt's ability to draw images on the background of the terminal. Unfortunately, urxvt comes with a slew of problems surrounding Powerline fonts which caused me to switch to Termite (and yes, I made sure to use the vanilla flag and even tried compiling from github source with the flag for wide characters--my laptop just isn't having it with urxvt and I ran out of patience). With Termite, ranger must use the w3m method to provide image preview capability.

Alas, w3mimgdisplay simply will not display jpegs. It will show a PNG when invoked directly from the command line, and Ranger will preview a PNG with no complaint. However, it simply refuses to work with jpegs. It gives me the error message "Failed to execute w3mimgdisplay, []". Since a command line invocation against a jpeg also fails, I concluded this is not a problem with Ranger, but with w3m.

As a test, on Arch I compiled w3m from source and installed Termite and Ranger through Pacman. Setting ranger to use w3m and I had image previews on the first try of pngs and jpegs both. I also tried opening jpegs on the Gentoo machine with other applications, including ImageMagick and Terminology, and had no trouble with those applications. This leads me to conclude that the problem is not with w3m but with how I've installed it, configured gentoo, or with the w3m ebuild.

My local use flags for w3m:
Code:
www-client/w3m imlib lynxkeymap nntp unicode xface jpeg gif fbcon

(I realize some--like jpeg--are not even listed in the Portage docs)

My global use flags:
Code:
USE="X apparmor arping audit build cryptsetup curl dbus dracut elfutils \
     gcrypt gdm http idn importd ipv6 jbig jpeg jpeg2k kmod libidn2 lzma lz4 nat \
     -nettle -openssl pam pambase polkit python_targets_3_6 qrcode \
     resolvconf seccomp ssl sysv-utils usrmerge vanilla xkb \
     -consolekit systemd png xcb gui declarative network opengl \
     printsupport sql webengine widgets python_targets_python2_7 positioning \
     qt webchannel websockets xmlpatterns multimedia unicode \
     utils cxx djvu fontconfig jbig jpeg2k lcms openexr openmp perl \
     postscript tiff truetype wmf alsa"


I tried running
Code:
emerge -uDU --keep-going @world
a couple days ago to make sure all use flags were applied and that I had the latest versions of everything, but the problem persists.

Any pointers on what else to look at before I pass the blame on to the package maintainers will be greatly appreciated. Especially if you've got w3mimgdisplay playing nicely with jpegs!

(relevant github: https://github.com/ranger/ranger/issues/1170)

EDIT: Just tried removing the source-built version of w3m and emerging the newest ebuild (p201180125) and.... same problem. It's worth noting that this occurs in xtrem, too--which is ostensibly the only emulator that's "actually supported" in w3m.


Last edited by cantcsharp on Fri May 25, 2018 4:34 am; edited 1 time in total
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Wed May 23, 2018 7:30 am    Post subject: Reply with quote

Just to be clear, because you didn't mention but can you view jpeg from other applications on the system? Have you tried installing either feh, or some other image viewer to check and make sure that jpeg libraries (package is media-libs/jpeg are working correctly)? Also you may need to consider if this is related to your X server at all since that can change how graphics renders image on the system. But also global Use flags are sorta messy and a better way to go about it may be debugging the software application. So perhaps you can find some way to do just some of that and post results back here about it? Just trying to help, although I know there is not a lot of specific help included.
Back to top
View user's profile Send private message
cantcsharp
n00b
n00b


Joined: 22 May 2018
Posts: 4

PostPosted: Fri May 25, 2018 1:26 am    Post subject: Reply with quote

I can view jpegs with ImageMagick, yes. Edited OP accordingly.

With Ranger, I can get image previews to work in urxvt using the urxvt mode (which relies on pixbuf, if I understand correctly) and Terminology with the terminology mode. Both of these work fine with jpegs--it seems to be only w3m with a problem.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Fri May 25, 2018 8:23 am    Post subject: Reply with quote

cantcsharp, ok sorry I misunderstood. As for your initial question, no I can actually verify there is no issue with the package/method as I have it working just fine on my machine. It does appear that maybe some of your USE flags could be off. Also, this other thread may be of help: https://forums.gentoo.org/viewtopic-t-952780-start-0.html


With my install, here are the use flags I have:

Code:
[ebuild   R    ] www-client/w3m-0.5.3_p20180125::gentoo  USE="X fbcon imlib nls nntp ssl unicode xface -gdk-pixbuf -gpm -libressl -lynxkeymap" L10N="-de -ja" 0 KiB

So I noticed that some of these might be different than what you had there, but just double check (since I know some of the global USE flags are often curious about whether they do or don't get included in a specific package being merged).

Also, in terms of figuring out a solution for your case, I had the following situation that helped me to debug, and I wanted to share it so you might try a similar thing it is just a little trick with the terminal. That makes it easy to test the problem with an application like this one, which is just based on testing it in the following way: Open a terminal (any), and FROM THAT TERMINAL open a second terminal so you now have two screens but one in which to look for errors or other outpu of any kind relating to the second terminal running (where you will of course then launch ranger, or w3m or whatever to see what it does in terms of output back on the first terminal...make sense?). It worked for me, at least to identify a problem while testing on my end, which oddly enough I had exact opposite experience between w3m and urxvt modes since with mine the jpg format is rendered fine by w3mimgdisplay but it is unrecognized according to the test just mentioned when in the urxvt mode. I wonder if for my benefit you might have some ideas about how to get that working ha ha.
By the way, what happens when you try to open an image in w3m ?
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Fri May 25, 2018 9:14 am    Post subject: Reply with quote

Assuming you were reading up on Ranger then make sure you also take a look at the list they provide of Troubleshooting tips for this situation, including different terminal emulator among other things
Back to top
View user's profile Send private message
cantcsharp
n00b
n00b


Joined: 22 May 2018
Posts: 4

PostPosted: Mon Jun 04, 2018 2:18 pm    Post subject: Reply with quote

Quote:
Assuming you were reading up on Ranger then make sure you also take a look at the list they provide of Troubleshooting tips for this situation, including different terminal emulator among other things


That's where I started--I even went as far as opening an issue on Github. That's what led me to the conclusion that the problem was outside of Ranger.

I'm glad to hear someone has it working, because that means there's something relatively easy to fix that I missed :) . Unfortunately, my emerge --info shows the same set of USE flags (the one difference being -lynxkeymap). So, I guess the problem may be with a dependency?
Back to top
View user's profile Send private message
cantcsharp
n00b
n00b


Joined: 22 May 2018
Posts: 4

PostPosted: Mon Jun 04, 2018 2:40 pm    Post subject: Reply with quote

AHA!

Code:
media-libs/imlib2-1.4.9::gentoo was built with the following:
USE="X bzip2 nls png tiff zlib -doc -gif -jpeg -mp3 -static-libs" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2 (-mmx)"


I guess this didn't get updated last time I ran emerge against @world (probably forgot -N), so the global jpeg flag didn't get applied to imlib. Once I ran
Code:
 emerge -N media-libs/imlib2
ranger's jpeg preview started working.


LIsLinuxIsSogood, I appreciate your help with this. The fix was predictably simple, as it always is :roll: , but you helped my find where the problem is and saved me a lot of frustration xD Thank you!

I should add for future Googlers:

Once it looked like a dependency of w3m might be the problem, these commands led me to this info:

Code:
$ equery depgraph w3m

 * Searching for w3m ...

 * dependency graph for www-client/w3m-0.5.3_p20180125
 `--  www-client/w3m-0.5.3_p20180125  amd64
   `--  dev-libs/boehm-gc-7.6.4  (dev-libs/boehm-gc) amd64
   `--  sys-libs/ncurses-6.1-r2  (sys-libs/ncurses) amd64
   `--  sys-libs/zlib-1.2.11-r1  (sys-libs/zlib) amd64
   `--  x11-libs/libXdmcp-1.1.2-r2  (x11-libs/libXdmcp) amd64
   `--  x11-libs/libXext-1.3.3-r1  (x11-libs/libXext) amd64
   `--  x11-libs/gdk-pixbuf-2.36.12  (x11-libs/gdk-pixbuf) amd64  [X?]
   `--  media-libs/imlib2-1.5.1  (media-libs/imlib2) ~amd64  [X?]
   `--  sys-libs/gpm-1.20.7-r2  (sys-libs/gpm) amd64
   `--  dev-libs/openssl-1.0.2o-r2  (dev-libs/openssl) ~amd64
   `--  dev-libs/libressl-2.6.4  (dev-libs/libressl) amd64
   `--  media-libs/compface-1.5.2  (media-libs/compface) amd64
   `--  virtual/pkgconfig-0-r1  (virtual/pkgconfig) amd64
   `--  app-portage/elt-patches-20170826.1  (>=app-portage/elt-patches-20170422) ~amd64
   `--  sys-devel/automake-1.16.1-r1  (>=sys-devel/automake-1.16.1) ~amd64
   `--  sys-devel/automake-1.15.1-r2  (>=sys-devel/automake-1.15.1) amd64
   `--  sys-devel/autoconf-2.69-r4  (>=sys-devel/autoconf-2.69) amd64
   `--  sys-devel/libtool-2.4.6-r5  (>=sys-devel/libtool-2.4) ~amd64
[ www-client/w3m-0.5.3_p20180125 stats: packages (18), max depth (1) ]

$ emerge --info imlib2
<the output of this is at the top of the post>
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Mon Jun 04, 2018 10:42 pm    Post subject: Reply with quote

Hey cantcsharp, so this was actually more a problem with the emerge command! I find these to be the more useful flags for system and world updates, -D -u -N. Best of luck to you!
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1179

PostPosted: Mon Jun 04, 2018 10:51 pm    Post subject: Reply with quote

That is of course if your goal is to Focus on all use flags updating throughout and not worried about how I could rebuild then just run new-use flag like you found out.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum