Skip to content

Commit

Permalink
fix: use round() instead of floor() for output image size (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed Aug 6, 2022
1 parent f55ae6e commit 42bb6cc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Example/EmbeddedCropViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ extension EmbeddedCropViewController: CropViewControllerDelegate {
}

func cropViewControllerDidEndResize(_ cropViewController: CropViewController, original: UIImage, cropInfo: CropInfo) {
// cropViewController.getExpectedCropImageSize() uses floor() to get integer image width and height
// If you use this size to check if it is less than an upper limit, you may need to add 1 to width and height
// to make sure the size is valid
let size = cropViewController.getExpectedCropImageSize()
self.resolutionLabel.text = "\(Int(size.width)) x \(Int(size.height)) pixels"
}
Expand Down

0 comments on commit 42bb6cc

Please sign in to comment.