[gimp] PFM: Fix writing with ',' as decimal separator



commit fff0717632d402d62d57b3ac9cb604f09e8ab6a6
Author: Tobias Ellinghaus <me houz org>
Date:   Mon Apr 16 23:54:45 2018 +0200

    PFM: Fix writing with ',' as decimal separator
    
    Some locales (like German) use ',' as the decimal separator, so using
    printf like functions to output a float value fails when the result
    should always use '.'. Since there are only two distinct possibilities
    we just write the string representation and be done with it.

 plug-ins/common/file-pnm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-pnm.c b/plug-ins/common/file-pnm.c
index fadd035..db53d27 100644
--- a/plug-ins/common/file-pnm.c
+++ b/plug-ins/common/file-pnm.c
@@ -1488,8 +1488,8 @@ save_image (GFile     *file,
     g_snprintf (buf, sizeof (buf), "%d %d\n%d\n", xres, yres,
                 rowinfo.bpc == 1 ? 255 : 65535);
   else
-    g_snprintf (buf, sizeof (buf), "%d %d\n%f\n", xres, yres,
-                G_BYTE_ORDER == G_BIG_ENDIAN ? 1.0f : -1.0f);
+    g_snprintf (buf, sizeof (buf), "%d %d\n%s\n", xres, yres,
+                G_BYTE_ORDER == G_BIG_ENDIAN ? "1.0" : "-1.0");
 
   if (! output_write (output, buf, strlen (buf), error))
     goto out;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]