aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-09-24 19:47:20 +0200
committerLars Ingebrigtsen2019-09-24 19:47:20 +0200
commit13f244af4044bf250307889bd6cd974ee665d01a (patch)
tree6a75fb28f93553f9c0556ac89a37c51425a9d653
parent7823dcf2fb0ac2bd1d0349be683a618d332758ff (diff)
downloademacs-13f244af4044bf250307889bd6cd974ee665d01a.tar.gz
emacs-13f244af4044bf250307889bd6cd974ee665d01a.zip
Make ImageMagick multi-image size calculations work for .ico files
* src/image.c (imagemagick_load_image): Compute image sizes correctly in multi-image .ico files and the like (bug#18333).
-rw-r--r--src/image.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c
index 06a8154842c..7cf1bc4c362 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8896,12 +8896,28 @@ imagemagick_load_image (struct frame *f, struct image *img,
8896 "super-wand". */ 8896 "super-wand". */
8897 if (MagickGetNumberImages (image_wand) > 1) 8897 if (MagickGetNumberImages (image_wand) > 1)
8898 { 8898 {
8899 MagickWand *super_wand = image_wand; 8899 /* This is an animated image (it has a delay), so compute the
8900 image_wand = imagemagick_compute_animated_image (super_wand, ino); 8900 composite image etc. */
8901 if (! image_wand) 8901 if (MagickGetImageDelay (image_wand) > 0)
8902 image_wand = super_wand; 8902 {
8903 MagickWand *super_wand = image_wand;
8904 image_wand = imagemagick_compute_animated_image (super_wand, ino);
8905 if (! image_wand)
8906 image_wand = super_wand;
8907 else
8908 DestroyMagickWand (super_wand);
8909 }
8903 else 8910 else
8904 DestroyMagickWand (super_wand); 8911 /* This is not an animated image: It's just a multi-image file
8912 (like an .ico file). Just return the correct
8913 sub-image. */
8914 {
8915 MagickWand *super_wand = image_wand;
8916
8917 MagickSetIteratorIndex (super_wand, ino);
8918 image_wand = MagickGetImage (super_wand);
8919 DestroyMagickWand (super_wand);
8920 }
8905 } 8921 }
8906 8922
8907 /* Retrieve the frame's background color, for use later. */ 8923 /* Retrieve the frame's background color, for use later. */