UIImagePickerController returning incorrect image orientation

前端 未结 6 1975
北荒
北荒 2020-12-25 08:10

I\'m using UIImagePickerController to capture an image and then store it. However, when i try to rescale it, the orientation value i get out of this image is incorrect. When

6条回答
  •  既然无缘
    2020-12-25 08:53

    Here's a Swift snippet that fixes the problem efficiently:

    let orientedImage = UIImage(CGImage: initialImage.CGImage, scale: 1, orientation: initialImage.imageOrientation)!
    

提交回复
热议问题