Krolyxon
Commit ac4eb53

Branches

Refs →

nsxivac4eb53

Fixed issue #28 (again)

Author
Bert Münnich
Date
2011-11-13 15:53 +0100
Parent
c4007be
Commit
ac4eb5302943a4c086445fa5efd41ff66851505f

+15 −11

3 files changed

  1. M Makefile +1 −1
  2. M image.c +8 −6
  3. M thumbs.c +6 −4
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20111111
1+VERSION = git-20111113
22
33 CC = gcc
44 CFLAGS = -ansi -Wall -pedantic -O2
M image.c View
@@ -311,16 +311,18 @@ bool img_load(img_t *img, const fileinfo_t *file) {
311311 imlib_image_set_changes_on_disk();
312312 imlib_context_set_anti_alias(img->aa);
313313
314− if ((fmt = imlib_image_format()) != NULL) {
314+ if ((fmt = imlib_image_format()) == NULL) {
315+ warn("could not open image: %s", file->name);
316+ return false;
317+ }
315318 #if EXIF_SUPPORT
316− if (STREQ(fmt, "jpeg"))
317− exif_auto_orientate(file);
319+ if (STREQ(fmt, "jpeg"))
320+ exif_auto_orientate(file);
318321 #endif
319322 #if GIF_SUPPORT
320− if (STREQ(fmt, "gif"))
321− img_load_gif(img, file);
323+ if (STREQ(fmt, "gif"))
324+ img_load_gif(img, file);
322325 #endif
323− }
324326
325327 img->w = imlib_image_get_width();
326328 img->h = imlib_image_get_height();
M thumbs.c View
@@ -253,10 +253,12 @@ bool tns_load(tns_t *tns, int n, const fileinfo_t *file,
253253 imlib_context_set_image(im);
254254 imlib_context_set_anti_alias(1);
255255
256− fmt = imlib_image_format();
257− /* avoid unused-but-set-variable warning */
258− (void) fmt;
259−
256+ if ((fmt = imlib_image_format()) == NULL) {
257+ if (!silent)
258+ warn("could not open image: %s", file->name);
259+ imlib_free_image_and_decache();
260+ return false;
261+ }
260262 #if EXIF_SUPPORT
261263 if (!cache_hit && STREQ(fmt, "jpeg"))
262264 exif_auto_orientate(file);