[gimp] plug-ins: simply ask the built-in sRGB profile for its strings



commit 4321cda30cd9c88803f5e1602b0e36fcb5eeabf0
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 15 00:08:27 2014 +0100

    plug-ins: simply ask the built-in sRGB profile for its strings
    
    instead of special casing it. And some minor code cleanup.

 plug-ins/common/lcms.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)
---
diff --git a/plug-ins/common/lcms.c b/plug-ins/common/lcms.c
index 2d36e33..0dc0920 100644
--- a/plug-ins/common/lcms.c
+++ b/plug-ins/common/lcms.c
@@ -509,14 +509,10 @@ lcms_icc_set (GimpColorConfig *config,
   g_return_val_if_fail (GIMP_IS_COLOR_CONFIG (config), GIMP_PDB_CALLING_ERROR);
   g_return_val_if_fail (image != -1, GIMP_PDB_CALLING_ERROR);
 
-  if (filename)
-    {
-      success = lcms_image_set_profile (image, NULL, filename, TRUE);
-    }
-  else
-    {
-      success = lcms_image_set_profile (image, NULL, config->rgb_profile, TRUE);
-    }
+  if (! filename)
+    filename = config->rgb_profile;
+
+  success = lcms_image_set_profile (image, NULL, filename, TRUE);
 
   return success ? GIMP_PDB_SUCCESS : GIMP_PDB_EXECUTION_ERROR;
 }
@@ -646,20 +642,14 @@ lcms_icc_info (GimpColorConfig *config,
       profile = NULL;
     }
 
-  if (profile)
-    {
-      if (name) *name = gimp_lcms_profile_get_model (profile);
-      if (desc) *desc = gimp_lcms_profile_get_description (profile);
-      if (info) *info = gimp_lcms_profile_get_summary (profile);
+  if (! profile)
+    profile = gimp_lcms_create_srgb_profile ();
 
-      cmsCloseProfile (profile);
-    }
-  else
-    {
-      if (name) *name = g_strdup ("sRGB");
-      if (desc) *desc = g_strdup ("GIMP built-in sRGB");
-      if (info) *info = g_strdup (_("Default GIMP RGB working space"));
-    }
+  if (name) *name = gimp_lcms_profile_get_model (profile);
+  if (desc) *desc = gimp_lcms_profile_get_description (profile);
+  if (info) *info = gimp_lcms_profile_get_summary (profile);
+
+  cmsCloseProfile (profile);
 
   return GIMP_PDB_SUCCESS;
 }
@@ -1122,7 +1112,6 @@ lcms_image_transform_indexed (gint32                    image,
       cmsDoTransform (transform, cmap, cmap, n_cmap_bytes / 3);
       cmsDeleteTransform (transform);
     }
-
   else
     {
       g_warning ("cmsCreateTransform() failed!");


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