emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 ee12c42: imagemagick-types needs to initialize ImageMagick


From: Paul Eggert
Subject: emacs-27 ee12c42: imagemagick-types needs to initialize ImageMagick
Date: Mon, 23 Dec 2019 20:22:50 -0500 (EST)

branch: emacs-27
commit ee12c421b61218a868712f66b0176c451e20717e
Author: Dhruva Krishnamurthy <address@hidden>
Commit: Paul Eggert <address@hidden>

    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
---
 src/image.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/image.c b/src/image.c
index 70d932f..fc90c5e 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8603,6 +8603,17 @@ extern WandExport void PixelGetMagickColor (const 
PixelWand *,
                                            MagickPixelPacket *);
 #endif
 
+static void
+imagemagick_initialize (void)
+{
+  static bool imagemagick_initialized;
+  if (!imagemagick_initialized)
+    {
+      imagemagick_initialized = true;
+      MagickWandGenesis ();
+    }
+}
+
 /* Log ImageMagick error message.
    Useful when an ImageMagick function returns the status `MagickFalse'.  */
 
@@ -8874,14 +8885,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
   double rotation;
   char hint_buffer[MaxTextExtent];
   char *filename_hint = NULL;
-
-  /* Initialize the ImageMagick environment.  */
-  static bool imagemagick_initialized;
-  if (!imagemagick_initialized)
-    {
-      imagemagick_initialized = true;
-      MagickWandGenesis ();
-    }
+  imagemagick_initialize ();
 
   /* Handle image index for image types who can contain more than one image.
      Interface :index is same as for GIF.  First we "ping" the image to see how
@@ -9290,6 +9294,7 @@ and `imagemagick-types-inhibit'.  */)
   char **imtypes;
   size_t i;
 
+  imagemagick_initialize ();
   ex = AcquireExceptionInfo ();
   imtypes = GetMagickList ("*", &numf, ex);
   DestroyExceptionInfo (ex);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]