我正在将 CIFilter 应用于肖像图像。由于某种原因,它顺时针旋转了 90 度。我怎样才能解决这个问题?我的代码如下
var imgOrientation = oImage.imageOrientation
var imgScale = oImage.scale
let originalImage = CIImage(image: oImage)
var filter = CIFilter(name: "CIPhotoEffect"+arr[sender.tag-1000])
filter.setDefaults()
filter.setValue(originalImage, forKey: kCIInputImageKey)
var outputImage = filter.outputImage
var newImage = UIImage(CIImage:outputImage, scale:imgScale, orientation:imgOrientation)
cameraStill.image = newImage