0

I can load normal images: public.image types.
The Apple proRaw(adobe raw image type: DNG format) can be used in iPhone 12 series.
So, I captured with RAW image and I want to load the DNG file from app.
But I can't load the image using PHPicker. Normally, the codes below.

PHPickerConfiguration *configuration = [[PHPickerConfiguration alloc] init];
configuration.filter = [PHPickerFilter anyFilterMatchingSubfilters:@[[PHPickerFilter imagesFilter], [PHPickerFilter livePhotosFilter]]];

PHPickerViewController *pickerController = [[PHPickerViewController alloc] initWithConfiguration:configuration];
pickerController.delegate = self;
[pickerController setModalPresentationStyle:UIModalPresentationCustom];
[pickerController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[viewController presentViewController:pickerController animated:YES completion:nil];

-(void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results API_AVAILABLE(ios(14)) {
    [picker dismissViewControllerAnimated:YES completion:nil];
    
    PHPickerResult *result = [results firstObject];
    
    if ([result.itemProvider canLoadObjectOfClass:[UIImage class]]) {       // 1
        [result.itemProvider loadObjectOfClass:[NSObject class] completionHandler:^(__kindof id<NSItemProviderReading>  _Nullable object, NSError * _Nullable error) {
            if ([object isKindOfClass:[UIImage class]]) {
                UIImage *image = object;
                ...
            }
        }];
    }

In comment 1 line, returned NO.
How to load raw image using PHPicker?

strawnut
  • 299
  • 2
  • 17
  • You would need to set up the PHPickerConfiguration with the photo library, obtain the asset identifier, and return to the library to get the RAW data. – matt Jan 26 '21 at 05:06
  • @matt I understand what you mean. If obtain PHAsset using the asset identifier, need to authorize to access photo library. But, actually PHPicker does not need to get authorization to access photo library. I want to keep this spec there is not authorization. – strawnut Jan 26 '21 at 07:12
  • Cool but then you cannot get the RAW data. – matt Jan 26 '21 at 07:28
  • @matt what the... I just need not RAW data, but full-sized image. Can I export UIImage from RAW data image? Just image. not additional data like depth info, geo data... – strawnut Jan 27 '21 at 01:15

0 Answers0