Photo taken with camera does not contain any ALAsset metadata

后端 未结 2 505
太阳男子
太阳男子 2020-12-30 11:24

The weirdest thing is happening. I have an action sheet which gives the user the choice to either take a photo with the camera or choose one from the camera roll. Upon the U

2条回答
  •  一个人的身影
    2020-12-30 11:58

    In - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

    Try this when saving the Photo

        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeImageToSavedPhotosAlbum:image.CGImage
                                     metadata:[info objectForKey:UIImagePickerControllerMediaMetadata]
                              completionBlock:^(NSURL *assetURL, NSError *error) {
            NSLog(@"assetURL %@", assetURL);
        }];
    

提交回复
热议问题