diff options
| author | Karl Otness | 2018-08-27 21:57:44 -0400 |
|---|---|---|
| committer | Glenn Morris | 2018-08-27 22:03:42 -0400 |
| commit | 5729486951e6a60db55ea17ee3bac9baf8b54f6a (patch) | |
| tree | 2ec07950a5108b4f3b2609a66745e6c59a2a1a41 /src | |
| parent | f1acdff5e04df90821732333c1bb9d8f586f08d2 (diff) | |
| download | emacs-5729486951e6a60db55ea17ee3bac9baf8b54f6a.tar.gz emacs-5729486951e6a60db55ea17ee3bac9baf8b54f6a.zip | |
Support ImageMagick version 7 (bug#25967)
* configure.ac, src/image.c: Add support for ImageMagick version 7.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c index b9ff3f25c43..7e518ce34f8 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8273,11 +8273,20 @@ imagemagick_image_p (Lisp_Object object) | |||
| 8273 | /* The GIF library also defines DrawRectangle, but its never used in Emacs. | 8273 | /* The GIF library also defines DrawRectangle, but its never used in Emacs. |
| 8274 | Therefore rename the function so it doesn't collide with ImageMagick. */ | 8274 | Therefore rename the function so it doesn't collide with ImageMagick. */ |
| 8275 | #define DrawRectangle DrawRectangleGif | 8275 | #define DrawRectangle DrawRectangleGif |
| 8276 | #include <wand/MagickWand.h> | 8276 | |
| 8277 | #if IMAGEMAGICK_MAJOR == 6 | ||
| 8278 | # include <wand/MagickWand.h> | ||
| 8279 | # include <magick/version.h> | ||
| 8280 | #else | ||
| 8281 | # include <MagickWand/MagickWand.h> | ||
| 8282 | # include <MagickCore/version.h> | ||
| 8283 | /* ImageMagick 7 compatibility definitions */ | ||
| 8284 | # define PixelSetMagickColor PixelSetPixelColor | ||
| 8285 | typedef PixelInfo MagickPixelPacket; | ||
| 8286 | #endif | ||
| 8277 | 8287 | ||
| 8278 | /* ImageMagick 6.5.3 through 6.6.5 hid PixelGetMagickColor for some reason. | 8288 | /* ImageMagick 6.5.3 through 6.6.5 hid PixelGetMagickColor for some reason. |
| 8279 | Emacs seems to work fine with the hidden version, so unhide it. */ | 8289 | Emacs seems to work fine with the hidden version, so unhide it. */ |
| 8280 | #include <magick/version.h> | ||
| 8281 | #if 0x653 <= MagickLibVersion && MagickLibVersion <= 0x665 | 8290 | #if 0x653 <= MagickLibVersion && MagickLibVersion <= 0x665 |
| 8282 | extern WandExport void PixelGetMagickColor (const PixelWand *, | 8291 | extern WandExport void PixelGetMagickColor (const PixelWand *, |
| 8283 | MagickPixelPacket *); | 8292 | MagickPixelPacket *); |
| @@ -8815,7 +8824,7 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 8815 | #endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */ | 8824 | #endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */ |
| 8816 | { | 8825 | { |
| 8817 | size_t image_height; | 8826 | size_t image_height; |
| 8818 | MagickRealType color_scale = 65535.0 / QuantumRange; | 8827 | MagickRealType color_scale = 65535.0 / (MagickRealType) QuantumRange; |
| 8819 | #ifdef USE_CAIRO | 8828 | #ifdef USE_CAIRO |
| 8820 | data = xmalloc (width * height * 4); | 8829 | data = xmalloc (width * height * 4); |
| 8821 | color_scale /= 256; | 8830 | color_scale /= 256; |