[gegl/wip/rishi/operation-shadhi] shadows-highlight: make compatible with babl-0.1.36



commit ac3d765834e3f9ce62d66f7cfca947c6201febdc
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Nov 11 15:45:16 2017 +0100

    shadows-highlight: make compatible with babl-0.1.36

 configure.ac                                       |    2 +-
 .../workshop/shadows-highlights-correction.c       |   15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index de8a1a6..2c7957a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ m4_define([gegl_stable],
 m4_define([gimp_full_name], [Generic Graphical Library])
 
 # required versions of external libraries
-m4_define([babl_required_version], [0.1.37])
+m4_define([babl_required_version], [0.1.36])
 m4_define([cairo_required_version], [1.12.2])
 m4_define([exiv2_required_version], [0.25])
 m4_define([gdk_pixbuf_required_version], [2.32.0])
diff --git a/operations/workshop/shadows-highlights-correction.c 
b/operations/workshop/shadows-highlights-correction.c
index 713ac5b..1f0e51e 100644
--- a/operations/workshop/shadows-highlights-correction.c
+++ b/operations/workshop/shadows-highlights-correction.c
@@ -56,11 +56,24 @@ property_double (highlights_ccorrect, _("Highlights color adjustment"), 50.0)
 
 #define SIGN(x) (((x) < 0) ? -1.f : 1.f)
 
+
+
 static void
 prepare (GeglOperation *operation)
 {
   const Babl *cie_laba = babl_format ("CIE Lab alpha float");
-  const Babl *cie_l    = babl_format ("CIE L float");
+  const Babl *cie_l;
+
+  if (!babl_format_exists ("CIE L float")) // XXX : only do this when babl is not sufficiently new
+  {
+      babl_format_new (
+         "name", "CIE L float",
+         babl_model ("CIE Lab"),
+         babl_type ("float"),
+         babl_component ("CIE L"),
+         NULL);
+  }
+  cie_l = babl_format ("CIE L float");
 
   gegl_operation_set_format (operation, "input",  cie_laba);
   gegl_operation_set_format (operation, "aux",    cie_l);


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