From a93fbc682e5574ea68eef58a09de609fb1cc5cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 24 Feb 2024 18:14:36 +0100 Subject: [PATCH] app,libgimpcolor: drop babl if guards that no longer apply --- app/core/gimpcontext.c | 14 +------------- app/text/gimptextlayout.c | 4 ---- app/widgets/gimpcolorframe.c | 8 -------- libgimpcolor/gimpcolor.c | 11 ----------- 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 9042e55713..544707121d 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1957,15 +1957,7 @@ gimp_context_get_rgba_format (GimpContext *context, *space_image = image; } - if (color != NULL && - (space == NULL || -#if BABL_MINOR_VERSION > 1 || (BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION >= 107) - ! babl_space_is_rgb (space) || -#else - babl_space_is_cmyk (space) || - babl_space_is_gray (space) || -#endif - FALSE)) + if (color != NULL && (space == NULL || ! babl_space_is_rgb (space))) { format = gegl_color_get_format (color); space = babl_format_get_space (format); @@ -1973,11 +1965,7 @@ gimp_context_get_rgba_format (GimpContext *context, *space_image = NULL; } -#if BABL_MINOR_VERSION > 1 || (BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION >= 107) if (! babl_space_is_rgb (space)) -#else - if (babl_space_is_cmyk (space) || babl_space_is_gray (space)) -#endif { format = NULL; space = NULL; diff --git a/app/text/gimptextlayout.c b/app/text/gimptextlayout.c index 7869e38327..9b7c957654 100644 --- a/app/text/gimptextlayout.c +++ b/app/text/gimptextlayout.c @@ -150,11 +150,7 @@ gimp_text_layout_new (GimpText *text, pango_font_description_free (font_desc); target_space = gimp_image_get_layer_space (target_image); -#if BABL_MINOR_VERSION > 1 || (BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION >= 107) if (babl_space_is_rgb (target_space) || babl_space_is_gray (target_space)) -#else - if (! babl_space_is_cmyk (target_space)) -#endif layout->layout_space = target_space; else layout->layout_space = NULL; diff --git a/app/widgets/gimpcolorframe.c b/app/widgets/gimpcolorframe.c index 31797b1a17..d05ca56da5 100644 --- a/app/widgets/gimpcolorframe.c +++ b/app/widgets/gimpcolorframe.c @@ -858,11 +858,7 @@ gimp_color_frame_update (GimpColorFrame *frame) case GIMP_COLOR_PICK_MODE_RGB_PERCENT: case GIMP_COLOR_PICK_MODE_RGB_U8: -#if BABL_MINOR_VERSION > 1 || (BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION >= 107) if (babl_space_is_gray (space) || babl_space_is_rgb (space)) -#else - if (! babl_space_is_cmyk (space)) -#endif color_profile = gimp_babl_format_get_color_profile (format); /* TRANSLATORS: R for Red (RGB) */ @@ -935,11 +931,7 @@ gimp_color_frame_update (GimpColorFrame *frame) break; case GIMP_COLOR_PICK_MODE_GRAYSCALE: -#if BABL_MINOR_VERSION > 1 || (BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION >= 107) if (babl_space_is_gray (space) || babl_space_is_rgb (space)) -#else - if (! babl_space_is_cmyk (space)) -#endif color_profile = gimp_babl_format_get_color_profile (format); /* TRANSLATORS: V for Value (grayscale) */ diff --git a/libgimpcolor/gimpcolor.c b/libgimpcolor/gimpcolor.c index a517ded47f..536d73019a 100644 --- a/libgimpcolor/gimpcolor.c +++ b/libgimpcolor/gimpcolor.c @@ -335,17 +335,6 @@ gimp_babl_format_get_with_alpha (const Babl *format) model = babl_get_name (babl_format_get_model (format)); - /* Special-cased because babl_format_has_alpha() doesn't see that these - * formats encode alpha. This has been fixed with commit a28309c. - * TODO: remove this test when babl 0.1.110 is released and we depend on it. - */ -#if BABL_MINOR_VERSION == 1 && BABL_MICRO_VERSION <= 108 - if (g_strcmp0 (model, "HCYA") == 0 || - g_strcmp0 (model, "HSLA") == 0 || - g_strcmp0 (model, "HSVA") == 0) - return format; -#endif - /* Assuming we use Babl formats with same type for all components. */ type = babl_get_name (babl_format_get_type (format, 0));