if (BABL_IS_BABL (example_format))
{
- if (babl_format_is_palette (example_format))
- {
- /* XXX we should allocate a new palette name, and
- duplicate the path data, converted for new space
- */
- return example_format;
- }
encoding = babl_get_name (example_format);
if (babl_format_get_space (example_format) != babl_space ("sRGB"))
{
{
return NULL;
}
+ example_format = babl_format (encoding);
+
if (space == babl_space("sRGB"))
- return babl_format (encoding);
+ return example_format;
+
+ if (babl_format_is_palette (example_format))
+ {
+ /* XXX we should allocate a new palette name, and
+ duplicate the path data, converted for new space
+ */
+ return example_format;
+ }
- return format_new_from_format_with_space (babl_format (encoding), space);
+ return format_new_from_format_with_space (example_format, space);
}
int