[babl] babl: improve babl_trc_formula_srgb sRGB detection constants



commit d9ae32166b8fa90586959e3dd74e4227b90efdf9
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jan 2 21:05:02 2018 +0100

    babl: improve babl_trc_formula_srgb sRGB detection constants
    
    For bug #791816. Use constants as passed from GIMP when its built in sRGB ICC
    profile is passed.

 babl/babl-trc.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/babl/babl-trc.c b/babl/babl-trc.c
index 0a00710..11f79a6 100644
--- a/babl/babl-trc.c
+++ b/babl/babl-trc.c
@@ -424,10 +424,11 @@ babl_trc_formula_srgb (double g, double a, double b, double c, double d)
   int i;
   float params[5]={g, a, b, c, d};
 
-  if (fabs (g - 2.40)     < 0.01 &&
-      fabs (a - 26214)    < 0.01 &&
-      fabs (b - 0.947875) < 0.01 &&
-      fabs (c - (-3417))  < 0.01)
+  if (fabs (g - 2.400) < 0.01 &&
+      fabs (a - 0.947) < 0.01 &&
+      fabs (b - 0.052) < 0.01 &&
+      fabs (c - 0.077) < 0.01 &&
+      fabs (d - 0.040) < 0.01)
     return babl_trc ("sRGB");
 
   snprintf (name, sizeof (name), "%.6f %.6f %.4f %.4f %.4f", g, a, b, c, d);


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