[babl] babl: support creating babl spaces from input-class ICC profiles



commit 71f0b821ed6a5967449b6bf9d9b41a3a5d757559
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Jan 23 17:00:21 2021 +0100

    babl: support creating babl spaces from input-class ICC profiles

 babl/babl-icc.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/babl/babl-icc.c b/babl/babl-icc.c
index a0327463d..b5e426947 100644
--- a/babl/babl-icc.c
+++ b/babl/babl-icc.c
@@ -1008,19 +1008,19 @@ babl_space_from_icc (const char   *icc_data,
        return ret;
     }
 
-    if (strcmp (color_space.str, "RGB ")
-        && strcmp (color_space.str, "GRAY")
-    )
+    if (!(!strcmp (color_space.str, "RGB ")||
+          !strcmp (color_space.str, "GRAY")))
     {
       *error = "not defining RGB, CMYK or GRAY space..";
     }
     else
-     {
-       if (strcmp (profile_class.str, "mntr"))
-         *error = "not a monitor-class profile";
-       if (!strcmp (color_space.str, "GRAY"))
-         is_gray = 1;
-     }
+    {
+      if (!(!strcmp (profile_class.str, "mntr")||
+            !strcmp (profile_class.str, "scnr")))
+         *error = "not a display or input-class profile";
+      if (!strcmp (color_space.str, "GRAY"))
+        is_gray = 1;
+    }
   }
 
   if (!*error)


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