summaryrefslogtreecommitdiffstats
path: root/image.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 /image.c
parentc4007beb2eca82d19f4ef7a533c74a9fcfc435df (diff)
downloadnsxiv-ac4eb5302943a4c086445fa5efd41ff66851505f.tar.zst
Fixed issue #28 (again)
Diffstat (limited to 'image.c')
-rw-r--r--image.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/image.c b/image.c
index c6b6f31..65df889 100644
--- a/image.c
+++ b/image.c
@@ -311,16 +311,18 @@ bool img_load(img_t *img, const fileinfo_t *file) {
imlib_image_set_changes_on_disk();
imlib_context_set_anti_alias(img->aa);
- if ((fmt = imlib_image_format()) != NULL) {
+ if ((fmt = imlib_image_format()) == NULL) {
+ warn("could not open image: %s", file->name);
+ return false;
+ }
#if EXIF_SUPPORT
- if (STREQ(fmt, "jpeg"))
- exif_auto_orientate(file);
+ if (STREQ(fmt, "jpeg"))
+ exif_auto_orientate(file);
#endif
#if GIF_SUPPORT
- if (STREQ(fmt, "gif"))
- img_load_gif(img, file);
+ if (STREQ(fmt, "gif"))
+ img_load_gif(img, file);
#endif
- }
img->w = imlib_image_get_width();
img->h = imlib_image_get_height();