Description: Fixes locale problems in export to HTML feature This patch fixes a problem caused by certain locales in the export to HTML feature. In particular, in the wrong calculation of image size and other numerical values, in locales that use the dot as separator of thousands. Author: Leonardo Montecchi Last-Update: 2019-08-22 --- a/src/HdrHTML/hdrhtml.cpp +++ b/src/HdrHTML/hdrhtml.cpp @@ -792,10 +792,13 @@ void HDRHTMLSet::generate_webpage(const const char *out_dir, const char *object_output, const char *html_output, bool verbose) { if (image_list.empty()) return; + string user_locale = locale("").name(); + locale::global(locale::classic()); + ostringstream out_file_name; if (out_dir != NULL) out_file_name << out_dir << "/"; if (page_name == NULL) out_file_name << image_list.front().base_name << ".html"; else @@ -858,10 +861,11 @@ void HDRHTMLSet::generate_webpage(const print_image_htmlcode(hofs, this, NULL); } catch (pfs::Exception &e) { throw; } } + locale::global(locale(user_locale.c_str())); } void print_image_objects(ostream &out, void *user_data, const char *parameter) { HDRHTMLSet *hdrhtml_set = static_cast(user_data);