summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-10-24 11:14:01 +0200
committerBert Münnich <ber.t@posteo.de>2014-10-24 11:14:01 +0200
commit93e2a757d439b4965bf21b26a41628be9b2ec788 (patch)
treea781005cb53c6462f380f453c6affd70f46e0dc7 /image.c
parente15dabde747c71dfcf49e4818099c4cc526c2d21 (diff)
downloadnsxiv-93e2a757d439b4965bf21b26a41628be9b2ec788.tar.zst
Do not print could-not-open-warnings for files found by directory traversal
Diffstat (limited to 'image.c')
-rw-r--r--image.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/image.c b/image.c
index d4093bf..ee9c30d 100644
--- a/image.c
+++ b/image.c
@@ -292,7 +292,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file)
DGifCloseFile(gif);
#endif
- if (err && !file->loaded)
+ if (err && file->warn)
warn("corrupted gif file: %s", file->name);
if (img->multi.cnt > 1) {
@@ -321,7 +321,8 @@ bool img_load(img_t *img, const fileinfo_t *file)
if (access(file->path, R_OK) < 0 ||
(img->im = imlib_load_image(file->path)) == NULL)
{
- warn("could not open image: %s", file->name);
+ if (file->warn)
+ warn("could not open image: %s", file->name);
return false;
}