fix(imagepicker): 크롭 범위를 보정한다

This commit is contained in:
Yu Sung
2026-08-03 21:13:45 +09:00
parent 9320657bac
commit 2db4ef1c35
6 changed files with 442 additions and 15 deletions

View File

@@ -0,0 +1,15 @@
import CoreGraphics
enum ImageCropGeometry {
static func maximumCropSize(fitting imageSize: CGSize, aspectRatio: CGFloat) -> CGSize {
guard imageSize.width > 0, imageSize.height > 0, aspectRatio > 0 else {
return .zero
}
if imageSize.width / imageSize.height > aspectRatio {
return CGSize(width: imageSize.height * aspectRatio, height: imageSize.height)
}
return CGSize(width: imageSize.width, height: imageSize.width / aspectRatio)
}
}