From 298002c530501a0dc37978b79f0a9c8355668536 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 25 Nov 2019 15:44:28 +0000 Subject: [PATCH] fix build with imagemagick 6.7.8.9 Ships with centos7, so an important version to support. See https://github.com/libvips/libvips/issues/1479 --- ChangeLog | 1 + configure.ac | 10 ++++++++++ libvips/foreign/magick.c | 13 ++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 778e5f8d..86588ea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ 17/9/19 started 8.8.4 +- improve compatibility with older imagemagick versions 31/8/19 started 8.8.3 - revert sharpen restoring the input colourspace diff --git a/configure.ac b/configure.ac index 6d43b009..c0ef7413 100644 --- a/configure.ac +++ b/configure.ac @@ -698,6 +698,16 @@ if test x"$magick6" = x"yes"; then ] ) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [ColorspaceType colorspace = HCLpColorspace] + )], + [AC_DEFINE(HAVE_HCLPCOLORSPACE,1, + [define if your Magick has HCLpColorspace.]) + ] + ) + # GetImageMagick() takes two args under GM, three under IM AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( diff --git a/libvips/foreign/magick.c b/libvips/foreign/magick.c index 254da73c..b4f7b85f 100644 --- a/libvips/foreign/magick.c +++ b/libvips/foreign/magick.c @@ -515,21 +515,24 @@ static MagickColorspaceTypeNames magick_colorspace_names[] = { #ifdef HAVE_CMYCOLORSPACE { CMYColorspace, "CMYColorspace" }, { HCLColorspace, "HCLColorspace" }, - { HCLpColorspace, "HCLpColorspace" }, { HSBColorspace, "HSBColorspace" }, + { LabColorspace, "LabColorspace" }, + { LogColorspace, "LogColorspace" }, + { LuvColorspace, "LuvColorspace" }, +#endif /*HAVE_CMYCOLORSPACE*/ + +#ifdef HAVE_HCLPCOLORSPACE + { HCLpColorspace, "HCLpColorspace" }, { HSIColorspace, "HSIColorspace" }, { HSVColorspace, "HSVColorspace" }, - { LabColorspace, "LabColorspace" }, { LCHColorspace, "LCHColorspace" }, { LCHabColorspace, "LCHabColorspace" }, { LCHuvColorspace, "LCHuvColorspace" }, - { LogColorspace, "LogColorspace" }, { LMSColorspace, "LMSColorspace" }, - { LuvColorspace, "LuvColorspace" }, { scRGBColorspace, "scRGBColorspace" }, { xyYColorspace, "xyYColorspace" }, { YDbDrColorspace, "YDbDrColorspace" }, -#endif /*HAVE_CMYCOLORSPACE*/ +#endif /*HAVE_HCLPCOLORSPACE*/ /* im7 has this, I think *