AM_CONDITIONAL([HAVE_MAGICK],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
+PKG_CHECK_MODULES([MAGICK7], [ImageMagick >= 7.0.0],[
+ AM_CONDITIONAL([HAVE_MAGICK7],[true])],[
+ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK7],[false])])
+
PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[
AM_CONDITIONAL([HAVE_SILK],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
mod_LTLIBRARIES = mod_imagick.la
mod_imagick_la_SOURCES = mod_imagick.c
mod_imagick_la_CFLAGS = $(AM_CFLAGS) $(MAGICK_CFLAGS)
+
+if HAVE_MAGICK7
+mod_imagick_la_CFLAGS += -DHAVE_MAGIC7
+endif
+
mod_imagick_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(MAGICK_LIBS)
mod_imagick_la_LDFLAGS = -avoid-version -module -no-undefined -shared
#define MAGICKCORE_HDRI_ENABLE 0
#endif
+#ifdef HAVE_MAGIC7
+#include <MagickCore/MagickCore.h>
+#else
#include <magick/MagickCore.h>
-
+#endif
#ifdef _MSC_VER
// Disable MSVC warnings that suggest making code non-portable.
Image *tmp_images;
switch_snprintf(path, sizeof(path), "%s[%d]", context->path, pagenumber);
switch_set_string(context->image_info->filename, path);
+
+#ifdef HAVE_MAGIC7
+ if ((tmp_images = ReadImages(context->image_info, path, context->exception))) {
+#else
if ((tmp_images = ReadImages(context->image_info, context->exception))) {
+#endif
+
pagenumber++;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s page %d loaded\n", context->path, pagenumber);
AppendImageToList(&context->images, tmp_images);
switch_set_string(context->image_info->filename, path);
}
+#ifdef HAVE_MAGIC7
+ context->images = ReadImages(context->image_info, context->lazy ? range_path : path, context->exception);
+#else
context->images = ReadImages(context->image_info, context->exception);
+#endif
+
if (context->exception->severity != UndefinedException) {
CatchException(context->exception);
}