Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 可以从相机照片获取GPS exif数据_Ios_Objective C_Gps_Uiimagepickercontroller_Exif - Fatal编程技术网

Ios 可以从相机照片获取GPS exif数据

Ios 可以从相机照片获取GPS exif数据,ios,objective-c,gps,uiimagepickercontroller,exif,Ios,Objective C,Gps,Uiimagepickercontroller,Exif,我有一个启动相机的应用程序: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = NO; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:picker animated:YES

我有一个启动相机的应用程序:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:NULL];
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
...
}
我实现了委托,以获取摄像机拍摄的图像:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:NULL];
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
...
}
在该代表的内部,如果可能的话,我想用GPS exif数据保存图像

拍照后的信息对象具有以下键:

UIImagePickerControllerMediaType
UIImagePickerControllerOriginalImage
UIImagePickerControllerMediaMetadata
元数据密钥似乎很有希望,但GPS exif数据似乎要么未包含,要么已剥离

{
        DPIHeight = 72;
        DPIWidth = 72;
        Orientation = 6;
        "{Exif}" =         {
          ... 
        };
        "{MakerApple}" =         {
          ...
        };
        "{TIFF}" =         {
          ...
        };
    };
我已经搜索了大量关于抓取图像url和提取exif数据的内容,但是我相信这只有在照片是从图库中挑选的,而不是从相机中拍摄的情况下才可能实现

我还将CoreLocation设置为“始终”,但这似乎没有什么区别

如果我从照片应用程序拍照,我知道GPS exif数据包括在内。我甚至可以将gallery中的照片添加到我的应用程序中,其中包含exif数据。然而,如果我从我的应用程序启动相机,似乎我无法获得GPS exif数据

这在iOS 11中可能吗