我试图从相机点击的图像的元数据中获取位置。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSDictionary *metadata = [info objectForKey: UIImagePickerControllerMediaMetadata];
NSLog(@"%@",metadata);
}
我得到的日志是
{ DPIHeight = 72; DPIWidth = 72; Orientation = 6; "{Exif}" = { ApertureValue = "2.526068811667588"; BrightnessValue = "1.530886431890497"; ColorSpace = 1; DateTimeDigitized = "2013:01:11 14:58:42"; DateTimeOriginal = "2013:01:11 14:58:42"; ExposureMode = 0; ExposureProgram = 2; ExposureTime = "0.0303030303030303"; FNumber = "2.4"; Flash = 32; FocalLenIn35mmFilm = 35; FocalLength = "1.85"; ISOSpeedRatings = ( 320 ); MeteringMode = 5; PixelXDimension = 640; PixelYDimension = 480; SceneType = 1; SensingMethod = 2; ShutterSpeedValue = "5.058893689053568"; WhiteBalance = 0; }; "{TIFF}" = { DateTime = "2013:01:11 14:58:42"; Make = Apple; Model = "iPad 2"; Software = "6.0"; XResolution = 72; YResolution = 72; }; }
但是没有gps坐标。注意-我的班级没有核心位置管理器。我不确定是否需要。我是否必须使用核心位置服务以编程方式将 GPS 坐标添加到我的图像中?