mirror of https://github.com/GNOME/gimp.git
app: transfer the right profile in gimp_image_new_from_drawable()
Use the drawable's profile not the image's.
This commit is contained in:
parent
f1f91ecc2f
commit
58f8808847
|
@ -165,6 +165,7 @@ gimp_image_new_from_drawable (Gimp *gimp,
|
||||||
GimpImageBaseType type;
|
GimpImageBaseType type;
|
||||||
gdouble xres;
|
gdouble xres;
|
||||||
gdouble yres;
|
gdouble yres;
|
||||||
|
GimpColorProfile *profile;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||||
|
@ -192,17 +193,13 @@ gimp_image_new_from_drawable (Gimp *gimp,
|
||||||
gimp_image_set_resolution (new_image, xres, yres);
|
gimp_image_set_resolution (new_image, xres, yres);
|
||||||
gimp_image_set_unit (new_image, gimp_image_get_unit (image));
|
gimp_image_set_unit (new_image, gimp_image_get_unit (image));
|
||||||
|
|
||||||
if (GIMP_IS_LAYER (drawable))
|
profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (drawable));
|
||||||
{
|
gimp_image_set_color_profile (new_image, profile, NULL);
|
||||||
GimpColorProfile *profile = gimp_image_get_color_profile (image);
|
|
||||||
gimp_image_set_color_profile (new_image, profile, NULL);
|
|
||||||
|
|
||||||
new_type = G_TYPE_FROM_INSTANCE (drawable);
|
if (GIMP_IS_LAYER (drawable))
|
||||||
}
|
new_type = G_TYPE_FROM_INSTANCE (drawable);
|
||||||
else
|
else
|
||||||
{
|
new_type = GIMP_TYPE_LAYER;
|
||||||
new_type = GIMP_TYPE_LAYER;
|
|
||||||
}
|
|
||||||
|
|
||||||
new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (drawable),
|
new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (drawable),
|
||||||
new_image, new_type));
|
new_image, new_type));
|
||||||
|
@ -289,7 +286,6 @@ gimp_image_new_from_buffer (Gimp *gimp,
|
||||||
format = gimp_buffer_get_format (paste);
|
format = gimp_buffer_get_format (paste);
|
||||||
has_alpha = babl_format_has_alpha (format);
|
has_alpha = babl_format_has_alpha (format);
|
||||||
|
|
||||||
/* create a new image (always of type GIMP_RGB) */
|
|
||||||
image = gimp_create_image (gimp,
|
image = gimp_create_image (gimp,
|
||||||
gimp_buffer_get_width (paste),
|
gimp_buffer_get_width (paste),
|
||||||
gimp_buffer_get_height (paste),
|
gimp_buffer_get_height (paste),
|
||||||
|
@ -309,8 +305,7 @@ gimp_image_new_from_buffer (Gimp *gimp,
|
||||||
}
|
}
|
||||||
|
|
||||||
profile = gimp_buffer_get_color_profile (paste);
|
profile = gimp_buffer_get_color_profile (paste);
|
||||||
if (profile)
|
gimp_image_set_color_profile (image, profile, NULL);
|
||||||
gimp_image_set_color_profile (image, profile, NULL);
|
|
||||||
|
|
||||||
layer = gimp_layer_new_from_buffer (paste, image,
|
layer = gimp_layer_new_from_buffer (paste, image,
|
||||||
gimp_image_get_layer_format (image,
|
gimp_image_get_layer_format (image,
|
||||||
|
|
Loading…
Reference in New Issue