babl: support creating babl spaces from input-class ICC profiles
authorØyvind Kolås <pippin@gimp.org>
Sat, 23 Jan 2021 16:00:21 +0000 (17:00 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sat, 23 Jan 2021 16:00:21 +0000 (17:00 +0100)
babl/babl-icc.c

index a0327463d158523f20a49f36cd88028077e2b3ae..b5e42694713c16a39be04ac03bb2c98908d16c15 100644 (file)
@@ -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)