summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2011-11-13 15:53:09 +0100
committerBert Münnich <ber.t@gmx.com>2011-11-13 15:53:09 +0100
commitac4eb5302943a4c086445fa5efd41ff66851505f (patch)
tree02a4924a5b5743b686dbdd627384dee0f0881e1d /thumbs.c
parentc4007beb2eca82d19f4ef7a533c74a9fcfc435df (diff)
downloadnsxiv-ac4eb5302943a4c086445fa5efd41ff66851505f.tar.zst
Fixed issue #28 (again)
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/thumbs.c b/thumbs.c
index 2540d25..451947e 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -253,10 +253,12 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file,
imlib_context_set_image(im);
imlib_context_set_anti_alias(1);
- fmt = imlib_image_format();
- /* avoid unused-but-set-variable warning */
- (void) fmt;
-
+ if ((fmt = imlib_image_format()) == NULL) {
+ if (!silent)
+ warn("could not open image: %s", file->name);
+ imlib_free_image_and_decache();
+ return false;
+ }
#if EXIF_SUPPORT
if (!cache_hit && STREQ(fmt, "jpeg"))
exif_auto_orientate(file);