core/octave/imread.patch

30 lines
684 B
Diff
Raw Normal View History

2011-06-23 12:02:26 +08:00
--- 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)
{