UIImage from camera is rotated 90 degrees - using extensions
问题 When Image data is returned and applied to a UIImage, if the data comes from the camera then the image appears rotated 90 degrees. I tried adding the extension UIImage { func correctlyOrientedImage() -> UIImage { if self.imageOrientation == UIImageOrientation.up { return self } UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale) self.draw(in: CGRect(origin: CGPoint(x: 0,y :0), size: CGSize(width: self.size.width, height: self.size.height)) ) let normalizedImage:UIImage =