[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No support for ImageMagick 7 in emacs-26
From: |
Eli Zaretskii |
Subject: |
Re: No support for ImageMagick 7 in emacs-26 |
Date: |
Tue, 27 Nov 2018 08:14:23 +0200 |
> Cc: address@hidden
> From: Paul Eggert <address@hidden>
> Date: Mon, 26 Nov 2018 17:38:28 -0800
>
> > - MagickRealType color_scale = 65535.0 / QuantumRange;
> > + double quantum_range = QuantumRange;
> > + MagickRealType color_scale = 65535.0 / quantum_range;
>
> We don't need to apply this to the emacs-26 branch, as it does not
> affect behavior and is used only to pacify a GCC warning. I suppose
> Gentoo enables warnings somehow, and doesn't want that warning. But in
> general we no longer worry about --enable-gcc-warnings diagnostics in
> the emacs-26 branch.
Agreed.
> So how about the attached patch for the emacs-26 branch?
Fine with me, except:
> --- a/src/image.c
> +++ b/src/image.c
> @@ -8272,11 +8272,20 @@ imagemagick_image_p (Lisp_Object object)
> /* The GIF library also defines DrawRectangle, but its never used in Emacs.
> Therefore rename the function so it doesn't collide with ImageMagick. */
> #define DrawRectangle DrawRectangleGif
> -#include <wand/MagickWand.h>
> +
> +#ifdef HAVE_IMAGEMAGICK7
> +# include <MagickWand/MagickWand.h>
> +# include <MagickCore/version.h>
> +/* ImageMagick 7 compatibility definitions. */
> +# define PixelSetMagickColor PixelSetPixelColor
> +typedef PixelInfo MagickPixelPacket;
> +#else
> +# include <wand/MagickWand.h>
> +# include <magick/version.h>
> +#endif
>
> /* ImageMagick 6.5.3 through 6.6.5 hid PixelGetMagickColor for some reason.
> Emacs seems to work fine with the hidden version, so unhide it. */
> -#include <magick/version.h>
> #if 0x653 <= MagickLibVersion && MagickLibVersion <= 0x665
> extern WandExport void PixelGetMagickColor (const PixelWand *,
> MagickPixelPacket *);
It makes little sense to me to move the inclusion of magick/version.h
into the v6 conditional, but leave the "#if 0x653" conditional
fragment and its comment outside that v6 conditional. AFAIU, we are
including version.h _because_ we want that second #if, right? So we
should keep them close together, and keep the comment explaining why
we do that before the code it explains. (Which begs the question
whether we need to include MagickCore/version.h for v7, but I'm not
going to bother about that.)
Thanks.