Open vitalrum opened 6 years ago
i have answer. Need to fix orientation of UIImage before present it in ImageView. I use this method (category of UIImage):
func fixedOrientation() -> UIImage {
if (self.imageOrientation == .up) {
return self
}
UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale)
let rect = CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height)
self.draw(in: rect)
let normalizedImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return normalizedImage
}
use like this:
let orientedImage = originalImage.fixedOrientation()
Glad you seem to have found a solution to this problem. Perhaps adding an image modification callback to the delegate would be helpful in this scenario.
Hi, thanks for good viewer. I have a trouble with Live Photos. I can pick it from library and display it in imageView. But close animation your library work very bad. I think problem with uiimage orientation