thimc / vifmimg

Image previews for Vifm (vi file manager) using Überzug
GNU General Public License v3.0
242 stars 26 forks source link

Added option to use jpeg or png for pdf-preview. #17

Closed TornaxO7 closed 3 years ago

TornaxO7 commented 4 years ago

Everytime when I wanted to see the preview of a pdf-file, it loaded longer than in ranger. After looking into the vifmimg code I add an option to convert the pdf-file into jpg which is in my opinion faster than converting it into png.

So the default converter-file-type will be jpg and if you still want to use png than you just need to add "png" as the seventh argument in your fileviewer:

fileviewer *.pdf
        \ vifmimg pdfpreview %px %py %pw %ph %f "png"
        \ %pc
        \ vifmimg clear

It converts now much faster than before (on my machine). Anyway I mainly changed the previewpdf() function in the vifmimg file. I hope this helps.