开发者

Images latitude and longitude like "Places" iphone app

I'm trying to find out what are the coordinates of a photo chosen from the photo library via "UIImagePickerController".

I present the imagePickerController:

[self presentModalViewController:imagePickerController animated:YES];

and then:

- (void)imagePickerC开发者_如何学运维ontroller:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
    selectedImage.image = image;
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

I looked in the documentation about the "editingInfo" dictionary but I think is not the right way. Help me please! Thank all very much!

Oscar


take a look at this so-thread. This should be done with the asset-lib-framework


imagePickerController:didFinishPickingImage:editingInfo: is deprecated, you should use - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info instead, although I don't believe it'll help you getting the coordinates (info contains the UIImagePickerControllerMediaMetadata key, but documentation says it only works when source is set to UIImagePickerControllerSourceTypeCamera). If you want to get the coordinates where a photo was shot you need to use ALAssetsLibrary, but will require to make your own picker (retrieve and arrange assets on your own, there should be some examples out there on how to do this). You can either use the valueForProperty: method from ALAsset class, or the metadata method from ALAssetRepresentation (which I believe returns a NSDictionary with the keys listed here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜