iOS10上[UIImage imageWithCIImage:scale:orientation]是否已断开?
以下代码不再适用于iOS10。图像数据保持未旋转状态 我已经确认该代码在iOS 8和iOS 9上有效iOS10上[UIImage imageWithCIImage:scale:orientation]是否已断开?,ios,uiimage,ios10,Ios,Uiimage,Ios10,以下代码不再适用于iOS10。图像数据保持未旋转状态 我已经确认该代码在iOS 8和iOS 9上有效 CIImage *i = [[CIImage alloc] initWithImage:image]; imageView.image = [UIImage imageWithCIImage:i scale:image.scale orientation:UIImageOrientationRight]; 有人遇到过同样的问题吗?这是一个bug,还是一个预期的更改?我猜UIImageView处
CIImage *i = [[CIImage alloc] initWithImage:image];
imageView.image = [UIImage imageWithCIImage:i scale:image.scale orientation:UIImageOrientationRight];
有人遇到过同样的问题吗?这是一个bug,还是一个预期的更改?我猜UIImageView处理图像旋转标志的方式已经发生了一些变化。我在任何地方都找不到提到的更改,但至少下面的代码是有效的
如果您需要更改CIImage的方向,请尝试此操作
let newCIImage: CIImage
if #available(iOS 11.0, *) {
newCIImage = myCIImage.oriented(.right)
} else {
newCIImage = myCIImage.oriented(forExifOrientation: Int32(CGImagePropertyOrientation.right.rawValue))
}
let newCIImage: CIImage
if #available(iOS 11.0, *) {
newCIImage = myCIImage.oriented(.right)
} else {
newCIImage = myCIImage.oriented(forExifOrientation: Int32(CGImagePropertyOrientation.right.rawValue))
}