[gimp] app: use gimp_color_managed_get_color_profile()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use gimp_color_managed_get_color_profile()
- Date: Fri, 29 May 2015 22:59:24 +0000 (UTC)
commit 281a529b0c7d2f650ac3fe84d2d76148586c5afe
Author: Michael Natterer <mitch gimp org>
Date: Sat May 30 00:58:22 2015 +0200
app: use gimp_color_managed_get_color_profile()
instead of gimp_image_get_color_profile() and remove all fallback
code, GimpColorManaged always returns a profile.
app/display/gimpdisplayshell-title.c | 12 ++++--------
app/widgets/gimpimageprofileview.c | 18 +++++-------------
2 files changed, 9 insertions(+), 21 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c
index f0598d1..27cacce 100644
--- a/app/display/gimpdisplayshell-title.c
+++ b/app/display/gimpdisplayshell-title.c
@@ -19,8 +19,6 @@
#include <string.h>
-#include <lcms2.h>
-
#include <gegl.h>
#include <gtk/gtk.h>
@@ -39,7 +37,6 @@
#include "core/gimpcontainer.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
-#include "core/gimpimage-profile.h"
#include "core/gimpitem.h"
#include "gimpdisplay.h"
@@ -456,16 +453,15 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
case 'o': /* image's color profile name */
{
- GimpColorProfile *profile = gimp_image_get_color_profile (image,
- NULL);
+ GimpColorManaged *managed = GIMP_COLOR_MANAGED (image);
+ GimpColorProfile *profile;
- if (! profile)
- profile = gimp_lcms_create_srgb_profile ();
+ profile = gimp_color_managed_get_color_profile (managed);
i += print (title, title_len, i, "%s",
gimp_lcms_profile_get_label (profile));
- cmsCloseProfile (profile);
+ gimp_lcms_profile_close (profile);
}
break;
diff --git a/app/widgets/gimpimageprofileview.c b/app/widgets/gimpimageprofileview.c
index da2dad0..76cc405 100644
--- a/app/widgets/gimpimageprofileview.c
+++ b/app/widgets/gimpimageprofileview.c
@@ -102,21 +102,13 @@ gimp_image_profile_view_update (GimpImageParasiteView *view)
{
GimpImageProfileView *profile_view = GIMP_IMAGE_PROFILE_VIEW (view);
GimpImage *image;
- GimpColorProfile *profile;
- GError *error = NULL;
+ GimpColorManaged *managed;
+ GimpColorProfile profile;
- image = gimp_image_parasite_view_get_image (view);
+ image = gimp_image_parasite_view_get_image (view);
+ managed = GIMP_COLOR_MANAGED (image);
- profile = gimp_image_get_color_profile (image, &error);
-
- if (! profile && error)
- {
- g_message ("%s", error->message);
- g_clear_error (&error);
- }
-
- if (! profile)
- profile = gimp_lcms_create_srgb_profile ();
+ profile = gimp_color_managed_get_color_profile (managed);
gimp_color_profile_view_set_profile (profile_view->profile_view, profile);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]