aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--configure.ac2
-rw-r--r--src/sls.cpp4
-rw-r--r--src/sls.h6
4 files changed, 13 insertions, 2 deletions
diff --git a/README.md b/README.md
index aa843b6..eba1a01 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,8 @@ How to build
Requirements:
* a C++11 compiler
-* ImageMagick MagickWand, version 6 (optional, for MOT Slideshow)
+* ImageMagick MagickWand (optional, for MOT Slideshow),
+ version 6 (legacy) or 7
To install MagickWand on Debian or Ubuntu:
diff --git a/configure.ac b/configure.ac
index b5a11dd..52612c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,8 @@ fi
AS_IF([ pkg-config MagickWand ],
AC_DEFINE(HAVE_MAGICKWAND, [1], [Define if MagickWand is available]))
+AS_IF([ pkg-config "MagickWand < 7" ],
+ AC_DEFINE(HAVE_MAGICKWAND_LEGACY, [1], [Define if a legacy (prior to version 7) MagickWand is available]))
AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git'])
diff --git a/src/sls.cpp b/src/sls.cpp
index 9df7824..1111088 100644
--- a/src/sls.cpp
+++ b/src/sls.cpp
@@ -229,7 +229,11 @@ size_t SLSManager::resizeImage(MagickWand* m_wand, unsigned char** blob, const s
height = height * 320.0 / width;
width = 320;
}
+#ifdef HAVE_MAGICKWAND_LEGACY
MagickResizeImage(m_wand, width, height, LanczosFilter, 1);
+#else
+ MagickResizeImage(m_wand, width, height, LanczosFilter);
+#endif
}
height = MagickGetImageHeight(m_wand);
diff --git a/src/sls.h b/src/sls.h
index 6dc9d47..0b5fae2 100644
--- a/src/sls.h
+++ b/src/sls.h
@@ -34,7 +34,11 @@
#include "pad_common.h"
#if HAVE_MAGICKWAND
-# include <wand/magick_wand.h>
+# if HAVE_MAGICKWAND_LEGACY
+# include <wand/magick_wand.h>
+# else
+# include <MagickWand/MagickWand.h>
+# endif
#endif
#include <sys/stat.h>