vimiv icon indicating copy to clipboard operation
vimiv copied to clipboard

Any way to make it ignore certain files?

Open thepenguinthatwants opened this issue 5 years ago • 1 comments

Hi!

I usually have CR2 (RAW image) files in same folder than the JPG. Any way to make vimiv to ignore those files? As it seems vimiv cant render them.

thepenguinthatwants avatar May 10 '20 16:05 thepenguinthatwants

Unfortunately this is not possible and I would consider this a bug in the fileactions.is_image method, it should only return True if the image can also be opened. I will try to find a fix for this in general.

EDIT: Seems like the underlying gdk method: GdkPixbuf.Pixbuf.get_file_info thinks that cr2 images are tiff and thus supported. Not sure how to work around this then. You can probably add a hacky patch to this method though, something along:

def is_image(filename):
    """Check whether a file is an image.

    Args:
        filename: Name of file to check.
    """
    if os.path.splitext(filename)[1].lower() in (".cr2", ):
        return False
    try:
        ...

karlch avatar May 10 '20 17:05 karlch