Package: luminance-hdr / 2.5.1+dfsg-3

60_hdrhtml_locale.diff Patch series | download
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
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 <lmontecchi@montex.org>
Last-Update: 2017-07-27

--- a/src/HdrHTML/hdrhtml.cpp
+++ b/src/HdrHTML/hdrhtml.cpp
@@ -850,6 +850,9 @@
   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 << "/";
@@ -915,6 +918,7 @@
     }
   }
 
+  locale::global(locale(user_locale.c_str()));
 }
 
 void print_image_objects( ostream &out, void *user_data, const char *parameter )