Hi, I'm trying to find an explanation to strange behaviour of .clampedToExtent() method: I'm doing pretty strait forward thing, clamp the image and then crop it with some insets, so as a result I expert same image as original with padding on every side with repeating last pixel of each edge (to apply CIPixellate filter then), here is the code:
originalImage
.clampedToExtent()
.cropped(to: originalImage.extent.insetBy(dx: -50, dy: -50))
The result is strange: In the result image image has padding as specified, but only there sides have content there (left, right, bottom) and top side has transparent padding. Sometimes right side has transparency instead of content.
So the question is why this happens and how to get all sides filled with last pixel data?
I tested on two different devices with iOS 16 and 17.