How to get image metadata in ios

后端 未结 9 1752
独厮守ぢ
独厮守ぢ 2020-11-29 06:18

I want to display image metadata using ios. Meta data like Aperture, Shutterspeed, Exposure Compensation, ISO, Lens Focal Length, etc. So please help me if anybody has idea

9条回答
  •  旧时难觅i
    2020-11-29 06:43

    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
      NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL];
    
        if(referenceURL) {
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library assetForURL:referenceURL resultBlock:^(ALAsset *asset) {
            ALAssetRepresentation *rep = [asset defaultRepresentation];
            NSDictionary *metadata = rep.metadata;
            NSLog(@"image data %@", metadata);
    
    
        } failureBlock:^(NSError *error) {
            // error handling
        }];
    }
    

提交回复
热议问题