summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-12-28 19:04:20 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-12-28 19:04:20 +0100
commit91b331f0fa6999dff69fa1da90a8816b8d855ccc (patch)
treefd42dc8e86e68e10afb1a2a5bd8c93cb37a7d908 /src
parent8af3ee91e39a885ccee3d988ef944634f489ef14 (diff)
Always check file modification time before loading images from cache
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 48808a1..73b7039 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -256,6 +256,16 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
return(0);
}
+ /*
+ * By default, Imlib2 unconditionally loads a cached file without checking
+ * if it was modified on disk. However, feh (or rather its users) should
+ * expect image changes to appear at the next reload. So we tell Imlib2 to
+ * always check the file modification time and only use a cached image if
+ * the mtime was not changed. The performance penalty is usually negligible.
+ */
+ imlib_context_set_image(*im);
+ imlib_image_set_changes_on_disk();
+
#ifdef HAVE_LIBEXIF
int orientation = 0;
ExifData *exifData = exif_data_new_from_file(file->filename);