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 preview on vifm #27

Closed
derrickcope opened this issue Jun 28, 2018 · 5 comments
Closed

image preview on vifm #27

derrickcope opened this issue Jun 28, 2018 · 5 comments

Comments

@derrickcope
Copy link

It works fine in termite on arch linux but I am trying to have it preview file in vifm. This is what I have currently

fileviewer *.jpg, *.jpeg
\ /usr/local/bin/timg -g100x100 %c

I am getting an image but it is basically garbage
Does anyone have this working?

@hzeller
Copy link
Owner

hzeller commented Apr 30, 2020

This is typically because terminal programs keep tight control over what is being output to the terminal, so that it doesn't destory its UI. Maybe there is a configuration option for vifm to configure it to let color control codes through ?

@hzeller
Copy link
Owner

hzeller commented Feb 22, 2021

I tried a current version of vifm and it seems to work. I've just added it to the filextype like follows

filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
         \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
         \*.as[fx]
        \ {View in timg}
        \ timg --title --center --clear %f,

filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
        \ {View in timg}
        \ timg --title --center --clear %f; read -n1 -s -r -p "Press any key to return",

@hzeller
Copy link
Owner

hzeller commented Mar 14, 2021

Documentation about how to use in vifm now in the toplevel README.

@hzeller hzeller closed this as completed Mar 14, 2021
@JakeJing
Copy link

The proposed solution doesn't work. No image is shown in vifm. I tried it on kitty, iterm2 and WezTerm. My current setting in vifmrc looks like this:

fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
        \ timg -g %pwx%ph %f

It gives a blurry image preview. Adding -pk flag fails to view the image. Can you pls update the solution? Thanks!

@hzeller
Copy link
Owner

hzeller commented Jun 4, 2023

this is probably because vifm filters the extra escape codes used for the high resolution images. This is not something timg can work around, you need to ask the vifm project and ask how you can get that going.

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

No branches or pull requests

3 participants