leftMirrored照片的缩略图方向错误

时间:2015-07-24 20:30:23

标签: ios iphone swift swift2

我正在编写一个使用前置摄像头拍照的应用程序。我想在垂直轴上镜像图片,然后保存它们。

问题在于,当我查看默认的照片应用时,图像的缩略图会旋转180度。如果我点击它仍然在旋转的图片中的图片,但是我尝试放大的实例,它会根据我想要的镜像效果将其自身校正到我想要的旋转。有任何想法吗?这在Apple官方照片应用程序中发生。

我的镜像代码在这里:

var chosenImage = info[UIImagePickerControllerOriginalImage] as! UIImage
myImageView.contentMode = .ScaleAspectFit
myImageView.image = UIImage(CGImage: chosenImage.CGImage!, scale: chosenImage.scale, orientation: .LeftMirrored)
UIImageWriteToSavedPhotosAlbum(myImageView.image!, self, nil, nil)

1 个答案:

答案 0 :(得分:0)

仅改变方向并不会实际改变图像数据。需要手动保存/更改图像的方向