[gegl] jpg-load, png-load, tiff-load: show babl ICC to space errors as warnings



commit 60d9940d4b5d0803a90033e3da866ce3a5e2c311
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Jan 23 03:57:57 2021 +0100

    jpg-load, png-load, tiff-load: show babl ICC to space errors as warnings

 operations/external/jpg-load.c  | 2 ++
 operations/external/png-load.c  | 5 ++++-
 operations/external/tiff-load.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c
index f61ab8fb0..68fd73abc 100644
--- a/operations/external/jpg-load.c
+++ b/operations/external/jpg-load.c
@@ -188,6 +188,8 @@ static const Babl *jpg_get_space (struct jpeg_decompress_struct *cinfo)
     ret = babl_space_from_icc ((char*)icc_data, (int)icc_len,
                                BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
                                &error);
+    if (error)
+      g_warning ("error creating space from icc: %s\n", error);
     free (icc_data);
     return ret;
   }
diff --git a/operations/external/png-load.c b/operations/external/png-load.c
index 28528bb33..3acbb5b1d 100644
--- a/operations/external/png-load.c
+++ b/operations/external/png-load.c
@@ -226,8 +226,11 @@ gegl_png_space (png_structp load_png_ptr,
       PNG_INFO_iCCP)
     {
       const char *error = NULL;
-      return babl_space_from_icc ((char*)profile, (int)proflen,
+      const Babl *space = babl_space_from_icc ((char*)profile, (int)proflen,
                                  BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
+      if (error)
+        g_warning ("unable to create babl space from icc: %s", error);
+      return space;
     }
 
   if (png_get_valid (load_png_ptr, load_info_ptr, PNG_INFO_sRGB))
diff --git a/operations/external/tiff-load.c b/operations/external/tiff-load.c
index fc5ab8728..fe3d8e1fb 100644
--- a/operations/external/tiff-load.c
+++ b/operations/external/tiff-load.c
@@ -597,6 +597,8 @@ query_tiff(GeglOperation *operation)
         const char *error = NULL;
         space = babl_space_from_icc ((char*)icc_profile, (gint)profile_size,
                                      BABL_ICC_INTENT_RELATIVE_COLORIMETRIC, &error);
+        if (error)
+          g_warning ("error creating space from icc: %s\n", error);
       }
 
   }


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