From 2d37cd91c6718316188e7fd99088cda0e627db74 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 30 Nov 2020 19:21:43 +0100 Subject: Check magic bytes before passing a file to Imlib2's loader This works around a regression in Imlib2, which makes (un)loadable file detection quite slow when handling e.g. large video files. See and for details. Closes #505 --- man/feh.pre | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'man/feh.pre') diff --git a/man/feh.pre b/man/feh.pre index d44f600..6dfa9e7 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -162,6 +162,23 @@ Use .Cm --conversion-timeout Ar timeout with a non-negative value to enable support for these formats. . +.Pp +. +As Imlib2 may take several seconds to determine whether it can load a file or +not +.Pq e.g. when attempting to open a large video , +.Nm +checks each file's header before loading it. +If it looks like an image, it is passed on to Imlib2, otherwise, it is +assumed to be unloadable. +This greatly improves performance when working in directories with mixed files +.Pq i.e., directories which do not exclusively contain image files . +If you think that Imlib2 can load a file which +.Nm +has determined to be likely not an image, set the environment variable +.Qq FEH_SKIP_MAGIC +to pass all files directly to Imlib2, bypassing the header check. +The environment variable's value does not matter, it just needs to be set. . .Sh OPTIONS . -- cgit v1.2.3