[gegl] crop: don't clip output to input bounding box



commit 1298d41c4939bf00b391be36bba4e2cbe1738d6f
Author: Ell <ell_se yahoo com>
Date:   Thu Jan 16 17:24:45 2020 +0200

    crop: don't clip output to input bounding box
    
    Let the bounding box of gegl:crop be exactly the cropped rect,
    rather than its intersection with the input's bounding box.  The
    latter used to work around a bug when the output of gegl:crop was
    used in-place, which should now be fixed.

 operations/core/crop.c | 14 --------------
 1 file changed, 14 deletions(-)
---
diff --git a/operations/core/crop.c b/operations/core/crop.c
index 554012e15..34e62de4e 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -115,12 +115,6 @@ gegl_crop_get_bounding_box (GeglOperation *operation)
   result.width  = o->width;
   result.height = o->height;
 
-  /* in_rect sometimes ends up as 0,0,0,0 and in those cases - other
-   * code ends up seg-faulting
-   */
-  if (in_rect->width != 0 && in_rect->height != 0)
-    gegl_rectangle_intersect (&result, &result, in_rect);
-
   return result;
 }
 
@@ -181,14 +175,6 @@ gegl_crop_process (GeglOperation        *operation,
 
       extent = *GEGL_RECTANGLE (o->x, o->y,  o->width, o->height);
 
-      /* The output buffer's extent must be a subset of the input buffer's
-       * extent; otherwise, if the output buffer is reused for in-place output,
-       * we might try to write to areas of the buffer that lie outside the
-       * input buffer, erroneously discarding the data.
-       */
-      gegl_rectangle_intersect (&extent,
-                                &extent, gegl_buffer_get_extent (input));
-
       if (gegl_rectangle_equal (&extent, gegl_buffer_get_extent (input)))
         output = g_object_ref (input);
       else


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