libgimp: formats with space are only for layers

gimp_drawable_get_format(): don't add the image's layer profile space
to channel and mask formats, it's only for layers.
This commit is contained in:
Michael Natterer 2019-01-30 11:26:01 +01:00
parent 08d75d795e
commit b41d60455f

View file

@ -428,28 +428,32 @@ gimp_drawable_get_format (gint32 drawable_ID)
if (format_str)
{
gint32 image_ID = gimp_item_get_image (drawable_ID);
GimpColorProfile *profile;
const Babl *space = NULL;
profile = gimp_image_get_color_profile (image_ID);
if (gimp_item_is_layer (drawable_ID))
{
GimpColorProfile *profile = gimp_image_get_color_profile (image_ID);
if (profile)
{
GError *error = NULL;
space =
gimp_color_profile_get_space (profile,
space = gimp_color_profile_get_space
(profile,
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
&error);
if (! space)
{
g_printerr ("%s: failed to create Babl space from profile: %s\n",
g_printerr ("%s: failed to create Babl space from "
"profile: %s\n",
G_STRFUNC, error->message);
g_clear_error (&error);
}
g_object_unref (profile);
}
}
if (gimp_drawable_is_indexed (drawable_ID))
{