From fa0e95941d6979e9871ce4222e582d6ee2a32b62 Mon Sep 17 00:00:00 2001 From: Jacob Boerema Date: Sat, 7 Feb 2026 13:31:21 -0500 Subject: [PATCH] plug-ins: don't fail loading gflare files with Windows line endings There was a report on reddit that the flare files on Windows were stored with Windows (\r\n) line endings and that gradient flare did not recognize these flare files. Since these files are text files there is no reason not to accept windows line endings. To do this, we adjust the header to not include the line feed and check for the header as a prefix instead of the whole line including line ending. Also adjust saving to add the line feed separately. --- plug-ins/gradient-flare/gradient-flare.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c index 3b172349fb..8ec7be65de 100644 --- a/plug-ins/gradient-flare/gradient-flare.c +++ b/plug-ins/gradient-flare/gradient-flare.c @@ -71,7 +71,7 @@ #define GRADIENT_RESOLUTION 360 #define GFLARE_NAME_MAX 256 -#define GFLARE_FILE_HEADER "GIMP GFlare 0.25\n" +#define GFLARE_FILE_HEADER "GIMP GFlare 0.25" #define SFLARE_NUM 30 #define DLG_PREVIEW_WIDTH 256 @@ -1366,8 +1366,8 @@ gflare_load (const gchar *filename, return NULL; } - if (fgets (header, sizeof(header), fp) == NULL - || strcmp (header, GFLARE_FILE_HEADER) != 0) + if (fgets (header, sizeof(header), fp) == NULL || + ! g_str_has_prefix (header, GFLARE_FILE_HEADER)) { g_warning (_("'%s' is not a valid GFlare file."), gimp_filename_to_utf8 (filename)); @@ -1588,7 +1588,7 @@ gflare_save (GFlare *gflare) return; } - fprintf (fp, "%s", GFLARE_FILE_HEADER); + fprintf (fp, "%s\n", GFLARE_FILE_HEADER); g_ascii_dtostr (buf[0], G_ASCII_DTOSTR_BUF_SIZE, gflare->glow_opacity); fprintf (fp, "%s %s\n", buf[0], gflare_modes[gflare->glow_mode]);