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
Add a way to selectively disable backends #4
Comments
Indeed, backends are all tried without distinction until one accepts the input. ThumbnailBackends could have a What do you think? |
Without using libmagic yet but only plain old |
Verifying if the type of the file in question is suitable for a particular backend before starting it, is certainly useful on its own. So I welcome your idea. But it is not the same what I was suggesting in this issue: for general purpose applications such as a file manager, it certainly makes sense trying to cover as much file types as possible. But for specialized applications such as mine that will ever only deal with one single type of files, such as images in my case, it makes sense to disable all backends not dealing with images from the beginning. So what I was requesting is a mechanism that would allow the calling application to tell vignette to only use backends dealing with a particular set of file types. The requirements for such a mechanism would be:
A sketch of such a mechanism could be:
|
Ok I see. |
An app using vignette could want to only keep a category of handled files. See #4
@RKrahl what do you think of https://github.com/hydrargyrum/vignette/commits/selective ? Would it suit your needs? |
Sorry for not responding to your last comment. I'm somewhat busy atm. I'll try to find some time to have a look. |
Ok, no worries. |
An app using vignette could want to only keep a category of handled files. See #4
@RKrahl I've just merged 2 big changes, the one you asked for: being able to select specific file types, and another for not starting every plugin for every file but only the most appropriate (by using MIME). |
Many thanks! I tried it and it works fine for me. |
I use vignette for a tool that works with photos. It features an overview window that uses vignette to display the thumbnails of the images. If I clear the cache to force recreation of the thumbnails, I get the following error messages for each image when I open the overview window:
It's certainly not surprising that the PDF backend fails on a JPG file. The creation of the thumbnails succeeds nevertheless. But the error messages are still annoying. So I disable the backends that are not useful for my application with:
This also speeds up creating the thumbnails by a factor of more then two.
While this works, fiddling that deep in the guts of a third party library is certainly not good practice. So I'd like to get a better solution to select the backends that should be tried.
The text was updated successfully, but these errors were encountered: