[gegl] operations/transform: avoid affine code path for CMYK formats



commit e713c5f3696dfabe3b85147a56db74bf535bd4c1
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jan 28 02:58:43 2019 +0100

    operations/transform: avoid affine code path for CMYK formats
    
    Work on tracking down the root issue has failed but it was
    found to be isolated to the affine code path - now we produce
    valid results for transforming CMYK buffers again.

 operations/transform/transform-core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 39beaa60e..eb3fa88d9 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -1651,6 +1651,9 @@ gegl_transform_process (GeglOperation        *operation,
     }
   else
     {
+      gboolean is_cmyk =
+       ((babl_get_model_flags (gegl_operation_get_format (operation, "output"))
+           & BABL_MODEL_FLAG_CMYK) != 0);
       /*
        * For other cases, do a proper resampling
        */
@@ -1661,7 +1664,10 @@ gegl_transform_process (GeglOperation        *operation,
                     const GeglRectangle *roi,
                     gint                 level) = transform_generic;
 
-      if (gegl_matrix3_is_affine (&matrix))
+      /* XXX; why does the affine code path mangle CMYK colors when
+              the generic one does not?
+       */
+      if (gegl_matrix3_is_affine (&matrix) && !is_cmyk)
         func = transform_affine;
 
       if (transform->sampler == GEGL_SAMPLER_NEAREST)


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