我使用ios的系统相机拍摄了两张照片,其中一张处于纵向模式,另一张处于横向模式,然后我使用imagePicker在我的应用中选择它们,如下所示:
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage* sourceImage = [info objectForKey:UIImagePickerControllerOriginalImage];
UIImageOrientation imageOrientation = sourceImage.imageOrientation;
NSLog(@"%d",imageOrientation);
}
请注意,我NS注销了刚刚选择的图像的UIImageOrientation值 . 结果是 portrait mode photo is 3 (代表UIImageOrientationRight)和 landscape mode photo is 0 (UIImageOrientationUp)的值我只是不明白为什么 . 有人可以解释一下吗?谢谢!
1 回答
无论设备方向如何,iPhone的相机都会保存照片,但它会为图像添加元信息,以便正确渲染此图像 .
imageOrientation
描述了应该旋转图像以正确渲染的度数 .