[SwiftUI] Adjusting non-square images to square(1:1) with clipShape

You might include images directly in your assets or fetch them from servers. If every image maintained a 1:1 ratio, life would be simple. Yet, most images in our albums are rectangular, having diverse width-to-height ratios.

Let me give you an example: a photo from my trip to Dumbo, NY. It’s vertically oriented — taller than its width.

It seems fine, right? the image seems perfectly clipped into a circle. However, if you add a red border, you can see the hidden frame.

Click Here

Tags: Images Square