nvim-telescope / telescope-media-files.nvim

Telescope extension to preview media files using Ueberzug.
MIT License
445 stars 46 forks source link

Fix previews (video, pdf) and support uppercase file extensions #40

Open jnk22 opened 1 year ago

jnk22 commented 1 year ago

Hi, I have just tried to setup this plugin in NeoVim.

First of all, thank you for keeping this plugin alive @Conni2461 and everyone else involved!

It seems there are a few problems with file previews in its current version (possibly partly related to the breaking change #35):

  1. Video preview does not work when viu is not installed
  2. PDF preview does not work due to preview script not finding the generated preview files
  3. Files with non-lowercase extensions are not supported

This PR is supposed to fix those things:

  1. As viu does not seem to be used for any previews (only chafa is), I have replaced the check for its existence with a check for ffmpegthumbailer which seems to be originally intended for that line.
  2. pdftoppm already appends the file extension .png when using the command option -png (This is at least true for my installed version, 23.03.0 - this might need double checking for earlier versions). Therefore I have removed the additional .png for the output file.
  3. When previewing image files with file extensions like .JPG or .MP4, I get the error message: unknown file ..image_path.JPG. I have added a line to make the extracted extension lowercase to match the following case patterns.

@HendrikPetertje Could you verify if these changes still work for you?