From c3339bc66cb9b634130babb613165d9a6c03c311 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Fri, 26 Jan 2024 12:32:06 +0000 Subject: [PATCH] handle IM6 with FilterTypes enum name --- configure.ac | 6 +++++- src/Gopts.h | 4 ++++ src/diptych.cc | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bf98f2c..a212e7d 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,11 @@ PKG_PROG_PKG_CONFIG AX_CXX_COMPILE_STDCXX([14], [noext], [mandatory]) -PKG_CHECK_MODULES(IMAGEMAGICK, [Magick++ >= 7.1.0]) +PKG_CHECK_MODULES(IMAGEMAGICK, [Magick++ >= 6.9.11]) +PKG_CHECK_EXISTS([Magick++ < 7.0.0], + [AC_DEFINE([HAVE_IM_RESIZE_FILTERTYPES], 1, + [Defined if IM resize filter enum type change])]) + AC_ARG_ENABLE(exiv2, AS_HELP_STRING([--disable-exiv2],[do not generate Exif]), diff --git a/src/Gopts.h b/src/Gopts.h index 37d4bcc..8304e58 100644 --- a/src/Gopts.h +++ b/src/Gopts.h @@ -20,7 +20,11 @@ struct _Gopts { struct { void (Magick::Image::*fptr)(const Magick::Geometry&); +#ifdef HAVE_IM_RESIZE_FILTERTYPES + Magick::FilterTypes filter; +#else Magick::FilterType filter; +#endif float ratio; } scale; diff --git a/src/diptych.cc b/src/diptych.cc index f402518..489a4d3 100644 --- a/src/diptych.cc +++ b/src/diptych.cc @@ -176,7 +176,11 @@ int main(int argc, char* const argv[]) thegopts.scale.fptr = &Magick::Image::resize; struct IMfltrs { const char* name; +#ifdef HAVE_IM_RESIZE_FILTERTYPES + Magick::FilterTypes fltr; +#else Magick::FilterType fltr; +#endif } imfltrs[] = { "Point", Magick::PointFilter,