Mercurial > octave-libgccjit
diff src/DLD-FUNCTIONS/__magick_read__.cc @ 10739:d27bd2f74137
src/DLD_FUNCTIONS/__magick_read__.cc: restore locale after GraphicsMagick initialisation
author | Soren Hauberg <hauberg@gmail.com> |
---|---|
date | Sun, 04 Jul 2010 11:44:50 +0200 |
parents | ad0b54ae206a |
children | 6035bf68a755 |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__magick_read__.cc Fri Jul 02 14:28:39 2010 -0700 +++ b/src/DLD-FUNCTIONS/__magick_read__.cc Sun Jul 04 11:44:50 2010 +0200 @@ -39,6 +39,7 @@ #ifdef HAVE_MAGICK #include <Magick++.h> +#include <clocale> octave_value_list read_indexed_images (std::vector<Magick::Image>& imvec, @@ -388,10 +389,17 @@ if (! initialized) { + // Save the locale as GraphicsMagick might change this (depending on version) + const char *static_locale = setlocale (LC_ALL, NULL); + const std::string locale (static_locale); + std::string program_name = octave_env::get_program_invocation_name (); Magick::InitializeMagick (program_name.c_str ()); + // Restore locale from before GraphicsMagick initialisation + setlocale (LC_ALL, locale.c_str ()); + initialized = true; }