aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhruva Krishnamurthy2019-12-23 17:20:06 -0800
committerPaul Eggert2019-12-23 17:20:47 -0800
commitee12c421b61218a868712f66b0176c451e20717e (patch)
tree46db2e64dd75971b6269420a35702c2ced3667ff
parent9eb871c8d102c548a53ab9a5fe212067863f5bff (diff)
downloademacs-ee12c421b61218a868712f66b0176c451e20717e.tar.gz
emacs-ee12c421b61218a868712f66b0176c451e20717e.zip
imagemagick-types needs to initialize ImageMagick
* src/image.c (imagemagick_initialize): New function, with body taken from imagemagick_load_image. (imagemagick_load_image, Fimagemagick_types): Use it. Copyright-paperwork-exempt: yes
-rw-r--r--src/image.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/image.c b/src/image.c
index 70d932f9edb..fc90c5ea74b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8603,6 +8603,17 @@ extern WandExport void PixelGetMagickColor (const PixelWand *,
8603 MagickPixelPacket *); 8603 MagickPixelPacket *);
8604#endif 8604#endif
8605 8605
8606static void
8607imagemagick_initialize (void)
8608{
8609 static bool imagemagick_initialized;
8610 if (!imagemagick_initialized)
8611 {
8612 imagemagick_initialized = true;
8613 MagickWandGenesis ();
8614 }
8615}
8616
8606/* Log ImageMagick error message. 8617/* Log ImageMagick error message.
8607 Useful when an ImageMagick function returns the status `MagickFalse'. */ 8618 Useful when an ImageMagick function returns the status `MagickFalse'. */
8608 8619
@@ -8874,14 +8885,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
8874 double rotation; 8885 double rotation;
8875 char hint_buffer[MaxTextExtent]; 8886 char hint_buffer[MaxTextExtent];
8876 char *filename_hint = NULL; 8887 char *filename_hint = NULL;
8877 8888 imagemagick_initialize ();
8878 /* Initialize the ImageMagick environment. */
8879 static bool imagemagick_initialized;
8880 if (!imagemagick_initialized)
8881 {
8882 imagemagick_initialized = true;
8883 MagickWandGenesis ();
8884 }
8885 8889
8886 /* Handle image index for image types who can contain more than one image. 8890 /* Handle image index for image types who can contain more than one image.
8887 Interface :index is same as for GIF. First we "ping" the image to see how 8891 Interface :index is same as for GIF. First we "ping" the image to see how
@@ -9290,6 +9294,7 @@ and `imagemagick-types-inhibit'. */)
9290 char **imtypes; 9294 char **imtypes;
9291 size_t i; 9295 size_t i;
9292 9296
9297 imagemagick_initialize ();
9293 ex = AcquireExceptionInfo (); 9298 ex = AcquireExceptionInfo ();
9294 imtypes = GetMagickList ("*", &numf, ex); 9299 imtypes = GetMagickList ("*", &numf, ex);
9295 DestroyExceptionInfo (ex); 9300 DestroyExceptionInfo (ex);