Skip to content

Commit

Permalink
fix(camera): correct photo resizing on iOS (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored Jun 17, 2021
1 parent ce65a1f commit bc56e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions camera/ios/Plugin/CameraExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ internal extension UIImage {
}
// adjust to preserve aspect ratio
var targetWidth = min(imageWidth, maxWidth)
var targetHeight = (imageHeight * targetWidth) / imageWidth
var targetHeight = (imageHeight * maxWidth) / imageWidth
if targetHeight > maxHeight {
targetWidth = (imageWidth * targetHeight) / imageHeight
targetWidth = (imageWidth * maxHeight) / imageHeight
targetHeight = maxHeight
}
// generate the new image and return
Expand Down

0 comments on commit bc56e03

Please sign in to comment.