all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: ulm@gentoo.org, emacs-devel@gnu.org
Subject: Re: No support for ImageMagick 7 in emacs-26
Date: Tue, 27 Nov 2018 08:14:23 +0200	[thread overview]
Message-ID: <83in0jgi80.fsf@gnu.org> (raw)
In-Reply-To: <056e8aae-9a70-54e2-f3fd-19ede5bef749@cs.ucla.edu> (message from Paul Eggert on Mon, 26 Nov 2018 17:38:28 -0800)

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 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.



  reply	other threads:[~2018-11-27  6:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25  8:26 No support for ImageMagick 7 in emacs-26 Ulrich Mueller
2018-11-25 16:26 ` Eli Zaretskii
2018-11-26  7:38   ` Ulrich Mueller
2018-11-26 17:38     ` Eli Zaretskii
2018-11-26 22:00       ` Ulrich Mueller
2018-11-26 22:07         ` Andreas Schwab
2018-11-27  5:48         ` Eli Zaretskii
2018-11-27  1:38     ` Paul Eggert
2018-11-27  6:14       ` Eli Zaretskii [this message]
2018-11-27 16:35         ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83in0jgi80.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.