[gimp] app: display profile name in "Color space" field of Image Properties.



commit b9ab461977b098200495e4385e6ca8075334b9b4
Author: Jehan <jehan girinstud io>
Date:   Wed Nov 11 23:14:21 2020 +0100

    app: display profile name in "Color space" field of Image Properties.
    
    "RGB color" is not a color space, only the model. To get full color
    space information, we want to display the model and associated profile
    name.
    Of course, the "Image Properties" dialog also has a tab displaying
    details about the color profile. Still it's better if the general info
    displays not too wrong label contents.
    
    Note: when the used color profile has no name, it will show "(unnamed
    profile)" which is still more informative than just the color model.

 app/widgets/gimpimagepropview.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpimagepropview.c b/app/widgets/gimpimagepropview.c
index 9a66917741..cabf0d7df1 100644
--- a/app/widgets/gimpimagepropview.c
+++ b/app/widgets/gimpimagepropview.c
@@ -25,6 +25,7 @@
 #include <gtk/gtk.h>
 
 #include "libgimpbase/gimpbase.h"
+#include "libgimpcolor/gimpcolor.h"
 #include "libgimpwidgets/gimpwidgets.h"
 
 #include "widgets-types.h"
@@ -409,6 +410,7 @@ static void
 gimp_image_prop_view_update (GimpImagePropView *view)
 {
   GimpImage         *image = view->image;
+  GimpColorProfile  *profile;
   GimpImageBaseType  type;
   GimpPrecision      precision;
   GimpUnit           unit;
@@ -453,9 +455,8 @@ gimp_image_prop_view_update (GimpImagePropView *view)
               unit == GIMP_UNIT_INCH ? _("ppi") : format_buf);
   gtk_label_set_text (GTK_LABEL (view->resolution_label), buf);
 
-  /*  color type  */
+  /*  color space  */
   type = gimp_image_get_base_type (image);
-
   gimp_enum_get_value (GIMP_TYPE_IMAGE_BASE_TYPE, type,
                        NULL, NULL, &desc, NULL);
 
@@ -463,7 +464,9 @@ gimp_image_prop_view_update (GimpImagePropView *view)
     {
     case GIMP_RGB:
     case GIMP_GRAY:
-      g_snprintf (buf, sizeof (buf), "%s", desc);
+      profile = gimp_color_managed_get_color_profile (GIMP_COLOR_MANAGED (image));
+      g_snprintf (buf, sizeof (buf), "%s: %s", desc,
+                  gimp_color_profile_get_label (profile));
       break;
     case GIMP_INDEXED:
       g_snprintf (buf, sizeof (buf),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]