From 52af9145d7c7556a35427545212a06195f51b8cb Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 27 Apr 2016 00:48:23 +0200 Subject: [PATCH] libgimpcolor: handle palette formats in gimp_color_profile_get_format() Return "R'G'B'[A] u8" and "TYPE_RGB[A]_8" and babl and lcms formats. I'm not sure which code triggered the warning about an unhandled format, but now it handles indexed images too. --- libgimpcolor/gimpcolorprofile.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c index 39a25abaed..05c2e68bbc 100644 --- a/libgimpcolor/gimpcolorprofile.c +++ b/libgimpcolor/gimpcolorprofile.c @@ -1482,6 +1482,21 @@ gimp_color_profile_get_format (const Babl *format, gray = TRUE; linear = FALSE; } + else if (babl_format_is_palette (format)) + { + if (has_alpha) + { + *lcms_format = TYPE_RGBA_8; + + return babl_format ("R'G'B'A u8"); + } + else + { + *lcms_format = TYPE_RGB_8; + + return babl_format ("R'G'B' u8"); + } + } else { g_printerr ("format: %s\n"