summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorAntti Korpi <an@cyan.io>2017-07-13 02:15:51 +0200
committerBert Münnich <ber.t@posteo.de>2017-09-08 22:04:44 +0200
commitecc363ec10dec864dd2c956b478549ff235fb3d6 (patch)
tree8aadf336f60d6c7e54fee3351ad23122e53821b8 /thumbs.c
parent20009c240bb7d22d9b7844c0868d21f34e2fbd2d (diff)
downloadnsxiv-ecc363ec10dec864dd2c956b478549ff235fb3d6.tar.zst
Add -p flag to disable writing of cache and temporary files
Closes #285.
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/thumbs.c b/thumbs.c
index 4f6c181..a9f4fe0 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <utime.h>
+#include "options.h"
#include "thumbs.h"
#include "util.h"
@@ -83,6 +84,9 @@ void tns_cache_write(Imlib_Image im, const char *filepath, bool force)
struct utimbuf times;
Imlib_Load_Error err = 0;
+ if (options->private_mode)
+ return;
+
if (stat(filepath, &fstats) < 0)
return;
@@ -270,7 +274,7 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only)
cache_hit = true;
}
#if HAVE_LIBEXIF
- } else if (!force) {
+ } else if (!force && !options->private_mode) {
int pw = 0, ph = 0, w, h, x = 0, y = 0;
bool err;
float zw, zh;