Skip to content

Commit

Permalink
fix: remove unnecessary checking logic for image origentations (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed Sep 29, 2023
1 parent 4f996c1 commit 08a684a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Sources/Mantis/Extensions/UIImageExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,11 @@ extension UIImage {
}

func isHorizontal() -> Bool {
let orientationArray: [UIImage.Orientation] = [.up, .upMirrored, .down, .downMirrored]
if orientationArray.contains(imageOrientation) {
return size.width > size.height
} else {
return size.height > size.width
}
return size.width > size.height
}

func horizontalToVerticalRatio() -> CGFloat {
let orientationArray: [UIImage.Orientation] = [.up, .upMirrored, .down, .downMirrored]
if orientationArray.contains(imageOrientation) {
return size.width / size.height
} else {
return size.height / size.width
}
return size.width / size.height
}

func crop(by cropInfo: CropInfo) -> UIImage? {
Expand Down

0 comments on commit 08a684a

Please sign in to comment.