-
Notifications
You must be signed in to change notification settings - Fork 885
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
w3m image preview banding/flickering #86
Comments
I have the same issue, but only with st (urxvt works fine). |
I have problem with some images in urxvt. Certain blocks of the images are shown as just white patches. But some images are shown clearly. Don't know how to pin-point the source of the error. |
I have the same issue with urxvt (some image previews are shown clearly while some have black patches). However, it runs fine in xterm. |
I resolved this by removing |
Been playing a bit with .Xresources, and found out that loading an Xft font caused URxvt to be messy with w3m image preview (random black stripes on preview). Xft fonts work fine with xterm. ! Fails ! Works |
Finally trace down the exact problem: I guess we cannot do anything about this in ranger |
I wanted to report the urxvt bug upstream. Is it me or is there no bugtraker ? |
There was some discussion about this a while back on the suckless mailing list. They were hoping to get it working with st. It looks like it may be a issue with w3m-img. |
Funny, I just received the confirmation mail for the urxvt mailing list today! Hell, I subscribed 15 days ago! Well, it's no use anymore. |
So did anyone ever find a fix for this? I tried to visit the w3m mailing list archives a few times (as referenced here: http://w3m.sourceforge.net/) but it seems the connection times out. Is there even still any development on w3m? By the way, seems to me there are two different issues going on here:
|
This is definitely a w3m problem and not a ranger one: w3mimgdisplay does not handle 32 bit colors. However, the project seems stagnant indeed and we'd have to fix it ouselves. A feature request can be opened on http://sourceforge.net/p/w3m/feature-requests/ but all of them seem to fall in /dev/null. Anyone else interested? |
w3m was handling visuals and colormaps incorrectly. It always used the default rather than taking it from where it wants to draw to. Here's a patch for it: |
How to apply this patch? |
Hi There, I managed to get it working perfectly by setting: In the ~/.config/ranger/rc.conf Cheers! |
@BwackNinja Thanks for the contribution to w3m. |
After applying @BwackNinja's patch I still had problems with resized images not being displayed correctly in urxvt with 32-bit enabled, showing semi-transparent artifacts on resized images. It looks like this is a bug (?) in imlib2, but can be worked around in w3m-img by using a different method for resizing the image. Now image preview in ranger works for me without Here is the patch, should be applied in addition to the one supplied by @BwackNinja: https://gist.github.com/fmthoma/f76a1b44e00d5ca972bb |
… (e.g. urxvt) imlib_render_image_on_drawable_at_size() tended to leave nasty semi-transparent artifacts in 32-bit mode. Apparently, resizing an image in 32-bit mode affects the alpha channel even if there is no transparency in the image. With this patch, resizing is done in 24-bit mode (or whatever depth the original image has) before converting the image to 32-bit and rendering it on the display. Origin: https://gist.github.com/fmthoma/f76a1b44e00d5ca972bb cf. https://github.com/hut/ranger/issues/86#issuecomment-166027119
@fmthoma Merged in Debian's w3m development repo. Thank you. |
Does it only break after my patch, or is it broken before? What library do you use for loading images, imlib or imlib2 or gkd-pixbuf? My patch applies only to the imlib2 backend. I did not test with termite, but it works on xterm (unchanged by my patch, since xterm does not support 32-bit color anyways) and urxvt. In gnome-terminal, ranger's image preview does not work (I don't know why), but w3mimgdisplay works. Have you tried running w3mimgdisplay separately? |
Installing from that repo, it's broken both before and after the patch. I tried using |
Okay, I did not try to install from the development repo. I just fetch the sources ( |
Fix the built-in help (perl.patch) https://bugs.archlinux.org/task/45608 Properly link w3mimgdisplay to x11 https://bbs.archlinux.org/viewtopic.php?id=196093 Fix rendering bug in w3mimgdisplay (w3m_rgba.patch) https://github.com/hut/ranger/issues/86 Don't ignore input tags with invalid types (form_unkown.patch) http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615843 Fix a segfault when using https (https.patch) https://bugzilla.redhat.com/show_bug.cgi?id=707994
The I don't use a background or transparency, so my banding "stripes" are black. |
Sorry for nitpicking but I'm aware of only one Linux distro that supplies As for the issue as a whole, not much can be done on our side. The way
@copycat-killer, I cannot reproduce the aspect ratio issues. Could you provide a confirmed test case? |
It seems to me improbable that Arch is the only distro without it as standard, anyway there is But enough discussing, let's focus on PySixel. All we have to do is to create a |
I feel that https://github.com/saitoha/PySixel is unmaintained. Perhaps, there is a better sixel binding. |
Sixel works on a limited number of terminals. |
Maybe it's not an ideal solution for everyone, but tmux has much better keyboard navigation in my experience (and actually has customizable keybindings). I've not once used termite's keybindings. Regardless, I don't think limited terminal support is any reason not to add support for sixel as a method. |
Yeah, PySixel is unmaintained, and works on a limited number of terminals. That's why there's libsixel-python. As soon as I have enough time I'll try to implement the above mentioned displayer. EDIT: well, |
Sixel support would certainly be nice if you could code it. It's a shame |
The advantage of Gentoo makes it very easy to compile configurations in programming languages, so I use |
That's an absurdly huge |
@hobarrera I am on gentoo linux. Gentoo's package manager makes it easy to compile st with a configuration file when it installs st. Thus, I can just reinstall the package after changing the configuration. It takes less than 30 seconds to reinstall st on gentoo. It seems |
You forgot to account for the amount of time it takes to fix your config to match upstream changes. Even with gentoo, there is more management overhead. You and I are happy to deal with that, but respect that not everyone is. |
You also forgot that I need to subscribe to some for of RSS, and keep an eye on newer releases. Like @Link-Satonaka mentioned, also update the config every time upstream changes. The idea of manually building from source (even if you build a package) will never be upstream because of the huge overhead. For those who prefer it: go ahead and use that, I've no issue. But don't expect the rest of the world to adopt that. |
On Gentoo, you don't build package manually. Gentoo's package manager, For now,
By the way, ordinary text configuration files are just as susceptible to upstream changes, and they can be harder to debug because there is hardly any useful debugging information for ordinary text configuration files. I used to update gitea and gitlab. It was hard to keep up with configuration file changes. At least, with gcc or GHC, compiler helps you find and fix errors. |
Hi, I got rid of the annoying black band across the previews by setting the border for ranger as true |
Just wanted to say that there is support for urxvt, but thus far it doesn't compile for me. |
The only workaround for the banding issue that worked for me is editing btw. I had exactly the same issue with xterm, even though it came up less often using 1/100 is reliable enough on my pc, still, not much lagging when scrolling through many images, using this patch, there is no need to set draw_borders true, which is a big plus for me |
Nice! That worked for me too. Is there any chance we could get such a workaround upstream? |
I'm experiencing this in Debian 10 Testing. |
I would like to give credence to the theory that it's Xft related because the issue is not present when I start URxvt with a bitmap font instead of an Xft font. |
I had the same flickering problem with |
adding |
I've being struggling with this for ages. set w3m_delay 0.1
The problem is mostly because of w3m as pictures show there only just milliseconds. |
This solved the problem for me. Thanks! |
the image shows in one blink. but xterm works fine.
The text was updated successfully, but these errors were encountered: