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.
This commit is contained in:
Michael Natterer 2016-04-27 00:48:23 +02:00
parent 3a34a2b54c
commit 52af9145d7
1 changed files with 15 additions and 0 deletions

View File

@ -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"