summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-12 19:28:02 +0200
committerBert <ber.t@gmx.com>2011-09-12 19:28:02 +0200
commitdad06c7561d6f0ca0ea8d7f104ade04ab0e051fd (patch)
treed2dd7b45aa80c926cc9b895c776c403b2366ea13 /image.c
parent32a65201bb2114790d98a73427fab80f41d94b97 (diff)
downloadnsxiv-dad06c7561d6f0ca0ea8d7f104ade04ab0e051fd.tar.zst
Much nicer handling of compile-time features
- *_SUPPORT enabled in config.h - XLIBS helper app prints lib flags needed for current settings
Diffstat (limited to 'image.c')
-rw-r--r--image.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/image.c b/image.c
index 8b4ff49..ea0e272 100644
--- a/image.c
+++ b/image.c
@@ -17,26 +17,27 @@
*/
#define _POSIX_C_SOURCE 200112L
+#define _FEATURE_CONFIG
#define _IMAGE_CONFIG
#include <string.h>
#include <unistd.h>
-#ifdef EXIF_SUPPORT
+#include "image.h"
+#include "options.h"
+#include "util.h"
+#include "config.h"
+
+#if EXIF_SUPPORT
#include <libexif/exif-data.h>
#endif
-#ifdef GIF_SUPPORT
+#if GIF_SUPPORT
#include <stdlib.h>
#include <sys/types.h>
#include <gif_lib.h>
#endif
-#include "image.h"
-#include "options.h"
-#include "util.h"
-#include "config.h"
-
#define ZOOMDIFF(z1,z2) ((z1) - (z2) > 0.001 || (z1) - (z2) < -0.001)
enum { MIN_GIF_DELAY = 50 };
@@ -70,7 +71,7 @@ void img_init(img_t *img, win_t *win) {
}
}
-#ifdef EXIF_SUPPORT
+#if EXIF_SUPPORT
void exif_auto_orientate(const fileinfo_t *file) {
ExifData *ed;
ExifEntry *entry;
@@ -115,7 +116,7 @@ void exif_auto_orientate(const fileinfo_t *file) {
}
#endif /* EXIF_SUPPORT */
-#ifdef GIF_SUPPORT
+#if GIF_SUPPORT
/* Originally based on, but in its current form merely inspired by Imlib2's
* src/modules/loaders/loader_gif.c:load(), written by Carsten Haitzler.
*/
@@ -301,11 +302,11 @@ bool img_load(img_t *img, const fileinfo_t *file) {
/* avoid unused-but-set-variable warning */
(void) fmt;
-#ifdef EXIF_SUPPORT
+#if EXIF_SUPPORT
if (!strcmp(fmt, "jpeg"))
exif_auto_orientate(file);
#endif
-#ifdef GIF_SUPPORT
+#if GIF_SUPPORT
if (!strcmp(fmt, "gif"))
img_load_gif(img, file);
#endif