From 4d798ecfed0a4efa3373353e161436d2e5f9a98c Mon Sep 17 00:00:00 2001 From: Jehan Date: Tue, 12 Dec 2023 17:00:35 +0900 Subject: [PATCH] libgimpcolor: improve warning to help with debugging. --- libgimpcolor/gimpcolor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libgimpcolor/gimpcolor.c b/libgimpcolor/gimpcolor.c index 65e8c39c93..4604090f92 100644 --- a/libgimpcolor/gimpcolor.c +++ b/libgimpcolor/gimpcolor.c @@ -384,7 +384,11 @@ gimp_babl_format_get_with_alpha (const Babl *format) else if (g_strcmp0 (model, "cairo-RGB24") == 0) new_model = "cairo-ARGB32"; - g_return_val_if_fail (new_model != NULL, format); + if (new_model == NULL) + { + g_warning ("%s: unsupported format \"%s\".", G_STRFUNC, babl_get_name (format)); + return format; + } name = g_strdup_printf ("%s %s", new_model, type); new_format = babl_format_with_space (name, format);