Mercurial > hg > octave-shane
changeset 10390:ad0b54ae206a
__magick_read__ (F__magick_read__): call Magick::InitializeMagick
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 03 Mar 2010 13:01:44 -0500 |
parents | 8a551f02f10d |
children | 59e34bcdff13 |
files | src/ChangeLog src/DLD-FUNCTIONS/__magick_read__.cc |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-03-03 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/__magick_read__.cc (F__magick_read__): + Call Magick::InitializeMagick. + 2010-03-02 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/__convn__.cc: Remove.
--- a/src/DLD-FUNCTIONS/__magick_read__.cc +++ b/src/DLD-FUNCTIONS/__magick_read__.cc @@ -29,6 +29,7 @@ #include <cmath> #include "file-stat.h" +#include "oct-env.h" #include "oct-time.h" #include "defun-dld.h" @@ -383,6 +384,17 @@ #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) {