From a4db478be3b008a51b8f7c32c20f9f4defae6a28 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 21 Feb 2008 16:10:24 +0000 Subject: [PATCH] optionally use GraphicsMagick --- ChangeLog | 1 + TODO | 5 ----- configure.in | 10 ++++++++-- libsrc/conversion/im_magick2vips.c | 10 ++++++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b01f3719..93a9caea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ - you can now set the jpeg quality factor for tiff pyramids (thanks Joe) - you can now shrink jpegs during read, see "man im_jpeg2vips" - added CMYK JPEG write +- optionally use GraphicsMagick (thanks Bob Friesenhahn) 12/12/07 started 7.13.3 - added "include " to VImage.cc to help gcc 4.3 diff --git a/TODO b/TODO index 85060b95..0e0b3ab6 100644 --- a/TODO +++ b/TODO @@ -61,11 +61,6 @@ WONTFIX or something like that? -- can we use GraphicsMagick instead of ImageMagick? - - no: current stable GraphicsMagick is missing (at least) QuantumRange and - GetNextImageAttribute() ... perhaps this will be fixed in 1.2 - - TIFF load/save should use meta system for unknown tags - balance should use new meta stuff diff --git a/configure.in b/configure.in index 6ab50228..1c41a3fd 100644 --- a/configure.in +++ b/configure.in @@ -180,12 +180,18 @@ if test x"$with_fftw3" != "xno"; then fi # ImageMagick ... detect attribute iteration too +# Optionally look for GraphicsMagick instead AC_ARG_WITH([magick], AS_HELP_STRING([--without-magick], [build without libMagic (default: test)])) +AC_ARG_WITH([magickpackage], AS_HELP_STRING([--with-magickpackage], [magickpackage to use (default: ImageMagick)])) + +if test x"$with_magickpackage" == "xno"; then + with_magickpackage=ImageMagick +fi if test x"$with_magick" != "xno"; then - PKG_CHECK_MODULES(MAGICK, ImageMagick, + PKG_CHECK_MODULES(MAGICK, $with_magickpackage, [AC_DEFINE(HAVE_MAGICK,1,[define if you have libMagick installed.]) - PACKAGES_USED="$PACKAGES_USED ImageMagick"], + PACKAGES_USED="$PACKAGES_USED $with_magickpackage"], [AC_MSG_WARN([libMagick not found; disabling Magick support])]) fi diff --git a/libsrc/conversion/im_magick2vips.c b/libsrc/conversion/im_magick2vips.c index d921764a..c4c37ff8 100644 --- a/libsrc/conversion/im_magick2vips.c +++ b/libsrc/conversion/im_magick2vips.c @@ -16,6 +16,8 @@ * - set RGB16/GREY16 if appropriate * 10/8/07 * - support 32/64 bit imagemagick too + * 21/2/08 Bob Friesenhahn + * - use MaxRGB if QuantumRange is missing */ /* @@ -85,6 +87,12 @@ im_magick2vips_header( const char *filename, IMAGE *im ) #include +/* pre-float Magick used to call this MaxRGB. + */ +#if !defined(QuantumRange) +# define QuantumRange MaxRGB +#endif + #ifdef WITH_DMALLOC #include #endif /*WITH_DMALLOC*/ @@ -211,7 +219,9 @@ parse_header( Read *read ) IMAGE *im = read->im; Image *image = read->image; +#ifdef HAVE_GETNEXTIMAGEATTRIBUTE const ImageAttribute *attr; +#endif /*HAVE_GETNEXTIMAGEATTRIBUTE*/ Image *p; int i;