nsxiv97a2c05
Fixed issue #74, conditional compilation of gif support
+9 −3
2 files changed
| @@ -1,10 +1,10 @@ | |||
| 1 | − | VERSION = git-20121220 | |
| 1 | + | VERSION = git-20121227 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| 5 | 5 | ||
| 6 | 6 | CC = gcc | |
| 7 | − | CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) | |
| 7 | + | CFLAGS = -Wall -pedantic -O2 -I$(PREFIX) -DHAVE_GIFLIB | |
| 8 | 8 | LDFLAGS = -L$(PREFIX) | |
| 9 | 9 | LIBS = -lX11 -lImlib2 -lgif | |
| 10 | 10 | ||
| @@ -23,7 +23,6 @@ | |||
| 23 | 23 | #include <string.h> | |
| 24 | 24 | #include <sys/types.h> | |
| 25 | 25 | #include <unistd.h> | |
| 26 | − | #include <gif_lib.h> | |
| 27 | 26 | ||
| 28 | 27 | #include "exif.h" | |
| 29 | 28 | #include "image.h" | |
| @@ -31,7 +30,10 @@ | |||
| 31 | 30 | #include "util.h" | |
| 32 | 31 | #include "config.h" | |
| 33 | 32 | ||
| 33 | + | #if HAVE_GIFLIB | |
| 34 | + | #include <gif_lib.h> | |
| 34 | 35 | enum { MIN_GIF_DELAY = 25 }; | |
| 36 | + | #endif | |
| 35 | 37 | ||
| 36 | 38 | float zoom_min; | |
| 37 | 39 | float zoom_max; | |
| @@ -92,6 +94,7 @@ void exif_auto_orientate(const fileinfo_t *file) { | |||
| 92 | 94 | } | |
| 93 | 95 | } | |
| 94 | 96 | ||
| 97 | + | #if HAVE_GIFLIB | |
| 95 | 98 | bool img_load_gif(img_t *img, const fileinfo_t *file) { | |
| 96 | 99 | GifFileType *gif; | |
| 97 | 100 | GifRowType *rows = NULL; | |
| @@ -261,6 +264,7 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { | |||
| 261 | 264 | ||
| 262 | 265 | return !err; | |
| 263 | 266 | } | |
| 267 | + | #endif /* HAVE_GIFLIB */ | |
| 264 | 268 | ||
| 265 | 269 | bool img_load(img_t *img, const fileinfo_t *file) { | |
| 266 | 270 | const char *fmt; | |
| @@ -284,8 +288,10 @@ bool img_load(img_t *img, const fileinfo_t *file) { | |||
| 284 | 288 | } | |
| 285 | 289 | if (STREQ(fmt, "jpeg")) | |
| 286 | 290 | exif_auto_orientate(file); | |
| 291 | + | #if HAVE_GIFLIB | |
| 287 | 292 | if (STREQ(fmt, "gif")) | |
| 288 | 293 | img_load_gif(img, file); | |
| 294 | + | #endif | |
| 289 | 295 | ||
| 290 | 296 | img->w = imlib_image_get_width(); | |
| 291 | 297 | img->h = imlib_image_get_height(); | |