我正在尝试更改图像的方向(CIImage *myImage),但它看起来没有任何效果。
CIImage *myImage2 = [myImage imageByApplyingOrientation:kCGImagePropertyOrientationUp];
我还尝试了其他方法:
CIImage *myImage2 = [myImage imageByApplyingOrientation:[@"1" intValue]];
CIImage *myImage2 = [myImage imageByApplyingTransform:[myImage imageTransformForOrientation:[@"5" intValue]]];
当我试图找出方向是否改变时:
NSLog(@"Image orientation %@",[[myImage properties] valueForKey:kCGImagePropertyOrientation]);
我得到了“空”。也尝试将“myImage2”保存到新图像,但打开后没有效果。看起来“imageByApplyingOrientation”方法根本不起作用。