Krolyxon
Commit 97a2c05

Branches

Refs →

nsxiv97a2c05

Fixed issue #74, conditional compilation of gif support

Author
Bert Münnich
Date
2012-12-27 16:43 +0100
Parent
cd929ea
Commit
97a2c05cc30adb3b90842b671607a05857db63a0

+9 −3

2 files changed

  1. M Makefile +2 −2
  2. M image.c +7 −1
M Makefile View
@@ -1,10 +1,10 @@
1−VERSION = git-20121220
1+VERSION = git-20121227
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
55
66 CC = gcc
7−CFLAGS = -Wall -pedantic -O2 -I$(PREFIX)
7+CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) -DHAVE_GIFLIB
88 LDFLAGS = -L$(PREFIX)
99 LIBS = -lX11 -lImlib2 -lgif
1010
M image.c View
@@ -23,7 +23,6 @@
2323 #include <string.h>
2424 #include <sys/types.h>
2525 #include <unistd.h>
26−#include <gif_lib.h>
2726
2827 #include "exif.h"
2928 #include "image.h"
@@ -31,7 +30,10 @@
3130 #include "util.h"
3231 #include "config.h"
3332
33+#if HAVE_GIFLIB
34+#include <gif_lib.h>
3435 enum { MIN_GIF_DELAY = 25 };
36+#endif
3537
3638 float zoom_min;
3739 float zoom_max;
@@ -92,6 +94,7 @@ void exif_auto_orientate(const fileinfo_t *file) {
9294 }
9395 }
9496
97+#if HAVE_GIFLIB
9598 bool img_load_gif(img_t *img, const fileinfo_t *file) {
9699 GifFileType *gif;
97100 GifRowType *rows = NULL;
@@ -261,6 +264,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
261264
262265 return !err;
263266 }
267+#endif /* HAVE_GIFLIB */
264268
265269 bool img_load(img_t *img, const fileinfo_t *file) {
266270 const char *fmt;
@@ -284,8 +288,10 @@ bool img_load(img_t *img, const fileinfo_t *file) {
284288 }
285289 if (STREQ(fmt, "jpeg"))
286290 exif_auto_orientate(file);
291+#if HAVE_GIFLIB
287292 if (STREQ(fmt, "gif"))
288293 img_load_gif(img, file);
294+#endif
289295
290296 img->w = imlib_image_get_width();
291297 img->h = imlib_image_get_height();