[gimp/alxsa-store-cmyk-profile-tiff: 4/4] plug-ins: Store CMYK profile in image on TIFF load




commit 984586f623dcca068eccf0bd1bce7bb54871f18d
Author: Alx Sa <cmyk student gmail com>
Date:   Thu Jul 14 03:29:12 2022 +0000

    plug-ins: Store CMYK profile in image on TIFF load
    
    Now that images can contain their simulation profile,
    we can use gimp_image_set_simulation_profile() to retain
    the CMYK profile when a TIFF image is loaded.
    It will then be accessible in GIMP's Image menu.

 plug-ins/file-tiff/file-tiff-load.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c
index d3113a6528..97b6440453 100644
--- a/plug-ins/file-tiff/file-tiff-load.c
+++ b/plug-ins/file-tiff/file-tiff-load.c
@@ -1014,7 +1014,6 @@ load_image (GFile        *file,
               space = gimp_color_profile_get_space (profile,
                                                     GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
                                                     error);
-              g_clear_object (&profile);
             }
           else
             {
@@ -1181,6 +1180,13 @@ load_image (GFile        *file,
             }
         }
 
+      /* attach CMYK profile to GimpImage if applicable */
+      if (profile && gimp_color_profile_is_cmyk (profile))
+        {
+          gimp_image_set_simulation_profile (*image, profile);
+          g_clear_object (&profile);
+        }
+
       /* attach non-CMYK color profile */
       if (profile)
         {


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