[gimp] app: use gimp_color_config_get_rgb_profile() in gimp_image_get_profile()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use gimp_color_config_get_rgb_profile() in gimp_image_get_profile()
- Date: Tue, 12 May 2015 22:42:58 +0000 (UTC)
commit abef515ef812b7f2164694988cf781d159f826d3
Author: Michael Natterer <mitch gimp org>
Date: Wed May 13 00:42:31 2015 +0200
app: use gimp_color_config_get_rgb_profile() in gimp_image_get_profile()
app/core/gimpimage-profile.c | 26 ++++++--------------------
1 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/app/core/gimpimage-profile.c b/app/core/gimpimage-profile.c
index 5d4f2fd..598b61b 100644
--- a/app/core/gimpimage-profile.c
+++ b/app/core/gimpimage-profile.c
@@ -135,39 +135,25 @@ GimpColorProfile
gimp_image_get_profile (GimpImage *image,
GError **error)
{
- GimpColorConfig *config;
const GimpParasite *parasite;
GimpColorProfile *profile = NULL;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- config = image->gimp->config->color_management;
-
parasite = gimp_image_get_icc_profile (image);
if (parasite)
{
- return gimp_lcms_profile_open_from_data (gimp_parasite_data (parasite),
- gimp_parasite_data_size (parasite),
- error);
+ profile = gimp_lcms_profile_open_from_data (gimp_parasite_data (parasite),
+ gimp_parasite_data_size (parasite),
+ error);
}
- else if (config->rgb_profile)
+ else
{
- GFile *file = g_file_new_for_path (config->rgb_profile);
-
- profile = gimp_lcms_profile_open_from_file (file, error);
-
- if (profile && ! gimp_lcms_profile_is_rgb (profile))
- {
- g_set_error (error, GIMP_ERROR, GIMP_FAILED,
- _("Color profile '%s' is not for RGB color space"),
- gimp_file_get_utf8_name (file));
- cmsCloseProfile (profile);
- profile = NULL;
- }
+ GimpColorConfig *config = image->gimp->config->color_management;
- g_object_unref (file);
+ profile = gimp_color_config_get_rgb_profile (config, error);
}
return profile;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]