FS-11022 #resolve ImageMagic 7 support
This commit is contained in:
parent
d7fb26b12a
commit
b32db0dcfb
|
@ -1389,6 +1389,10 @@ PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[
|
||||||
AM_CONDITIONAL([HAVE_MAGICK],[true])],[
|
AM_CONDITIONAL([HAVE_MAGICK],[true])],[
|
||||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])])
|
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],[
|
PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[
|
||||||
AM_CONDITIONAL([HAVE_SILK],[true])],[
|
AM_CONDITIONAL([HAVE_SILK],[true])],[
|
||||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
|
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])])
|
||||||
|
|
|
@ -6,6 +6,11 @@ if HAVE_MAGICK
|
||||||
mod_LTLIBRARIES = mod_imagick.la
|
mod_LTLIBRARIES = mod_imagick.la
|
||||||
mod_imagick_la_SOURCES = mod_imagick.c
|
mod_imagick_la_SOURCES = mod_imagick.c
|
||||||
mod_imagick_la_CFLAGS = $(AM_CFLAGS) $(MAGICK_CFLAGS)
|
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_LIBADD = $(switch_builddir)/libfreeswitch.la $(MAGICK_LIBS)
|
||||||
mod_imagick_la_LDFLAGS = -avoid-version -module -no-undefined -shared
|
mod_imagick_la_LDFLAGS = -avoid-version -module -no-undefined -shared
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,11 @@
|
||||||
#define MAGICKCORE_HDRI_ENABLE 0
|
#define MAGICKCORE_HDRI_ENABLE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MAGIC7
|
||||||
|
#include <MagickCore/MagickCore.h>
|
||||||
|
#else
|
||||||
#include <magick/MagickCore.h>
|
#include <magick/MagickCore.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
// Disable MSVC warnings that suggest making code non-portable.
|
||||||
|
@ -101,7 +104,13 @@ static void *SWITCH_THREAD_FUNC open_pdf_thread_run(switch_thread_t *thread, voi
|
||||||
Image *tmp_images;
|
Image *tmp_images;
|
||||||
switch_snprintf(path, sizeof(path), "%s[%d]", context->path, pagenumber);
|
switch_snprintf(path, sizeof(path), "%s[%d]", context->path, pagenumber);
|
||||||
switch_set_string(context->image_info->filename, path);
|
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))) {
|
if ((tmp_images = ReadImages(context->image_info, context->exception))) {
|
||||||
|
#endif
|
||||||
|
|
||||||
pagenumber++;
|
pagenumber++;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s page %d loaded\n", context->path, pagenumber);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s page %d loaded\n", context->path, pagenumber);
|
||||||
AppendImageToList(&context->images, tmp_images);
|
AppendImageToList(&context->images, tmp_images);
|
||||||
|
@ -229,7 +238,12 @@ static switch_status_t imagick_file_open(switch_file_handle_t *handle, const cha
|
||||||
switch_set_string(context->image_info->filename, path);
|
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);
|
context->images = ReadImages(context->image_info, context->exception);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (context->exception->severity != UndefinedException) {
|
if (context->exception->severity != UndefinedException) {
|
||||||
CatchException(context->exception);
|
CatchException(context->exception);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue