[babl] babl: special case palette formats in babl_format_with_space



commit e6fd9d4471349476b106374b81fc0655e090486b
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Dec 6 17:06:28 2018 +0100

    babl: special case palette formats in babl_format_with_space
    
    For now, re-return the original passed in format, this will as
    a starter not crash - while the color management is non-functional;
    the special casing will be made more elaborate with space support
    in babl-palette.

 babl/babl-format.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/babl/babl-format.c b/babl/babl-format.c
index 7b81cae..e532417 100644
--- a/babl/babl-format.c
+++ b/babl/babl-format.c
@@ -727,6 +727,13 @@ babl_format_with_space (const char *encoding, const Babl *space)
 
   if (BABL_IS_BABL (example_format))
   {
+    if (babl_format_is_palette (example_format))
+    {
+      /* XXX we should allocate a new palette name, and 
+             duplicate the path data, converted for new space
+       */
+      return example_format;
+    }
     encoding = babl_get_name (example_format);
     if (babl_format_get_space (example_format) != babl_space ("sRGB"))
     {


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