iOS UIImagePickerController result image orientation after upload

后端 未结 20 1930
长发绾君心
长发绾君心 2020-11-22 00:44

I am testing my iPhone application on an iOS 3.1.3 iPhone. I am selecting/capturing an image using a UIImagePickerController:

UIImagePickerCont         


        
20条回答
  •  隐瞒了意图╮
    2020-11-22 01:12

    If you enable editing, then the edited image (as opposed to the original) will be oriented as expected:

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.allowsEditing = YES;
    // set delegate and present controller
    
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        UIImage *photo = [info valueForKey:UIImagePickerControllerEditedImage];
        // do whatever
    }
    

    Enabling editing allows the user to resize and move the image before tapping "Use Photo"

提交回复
热议问题