summaryrefslogtreecommitdiff
path: root/extra/octave/imread.patch
blob: 4a7b73ea0ed8923a64b0e9242c997254b0d9349c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- src/DLD-FUNCTIONS/__magick_read__.cc.orig	2010-03-06 08:05:25.000000000 +0000
+++ src/DLD-FUNCTIONS/__magick_read__.cc	2009-08-25 09:26:01.000000000 +0100
@@ -30,6 +30,7 @@
 #include "defun-dld.h"
 #include "error.h"
 #include "ov-struct.h"
+#include "oct-env.h"
 
 #ifdef HAVE_MAGICK
 
@@ -359,6 +358,18 @@
 
 #ifdef HAVE_MAGICK
 
+  static bool initialized = false;
+
+  if (! initialized)
+    {
+      std::string program_name = octave_env::get_program_invocation_name ();
+
+      Magick::InitializeMagick (program_name.c_str ());
+
+      initialized = true;
+    }
+
+
   if (args.length () > 2 || args.length () < 1 || ! args(0).is_string ()
       || nargout > 3)
     {