From c4466d0c9faf2b860c274bf064632e11fb2d7694 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 29 Jan 2026 13:33:40 +0000 Subject: [PATCH] libgimpconfig: Fix number format issue with 5753ac75 When system settings use , instead of . for decimal separation, 5753ac75 broke for legacy XCF grid parasites because numbers were not encoded consistently. This patch brings back the sanitation step with g_ascii_dtostr () that ensures all numbers are saved with . decimal separation. --- libgimpconfig/gimpconfig-serialize.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libgimpconfig/gimpconfig-serialize.c b/libgimpconfig/gimpconfig-serialize.c index 930d71f93f..0f48497005 100644 --- a/libgimpconfig/gimpconfig-serialize.c +++ b/libgimpconfig/gimpconfig-serialize.c @@ -375,14 +375,18 @@ gimp_config_serialize_property (GimpConfig *config, } else { + gchar buf[4][G_ASCII_DTOSTR_BUF_SIZE]; gdouble rgba[4]; - gegl_color_get_pixel (color, babl_format ("R'G'B'A double"), rgba); + gegl_color_get_pixel (color, babl_format ("R'G'B'A double"), + rgba); + + for (gint i = 0; i < 4; i++) + g_ascii_dtostr (buf[i], G_ASCII_DTOSTR_BUF_SIZE, rgba[i]); gimp_config_writer_printf (writer, - "(color-rgba %f %f %f %f)", - rgba[0], rgba[1], rgba[2], - rgba[3]); + "(color-rgba %s %s %s %s)", + buf[0], buf[1], buf[2], buf[3]); } } else