1

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)imagePickerController:(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

Oscar TJ
  • 524
  • 3
  • 16
  • 1
    Duplicate of http://stackoverflow.com/questions/3778519/how-to-write-get-latitude-longitude-with-image-in-uiimagepickercontroller and http://stackoverflow.com/questions/6177606/iphone-get-uiimagepickercontroller-lat-lng/6454102#6454102 – Paul Lynch Sep 25 '11 at 19:16

2 Answers2

2

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

Community
  • 1
  • 1
thomas
  • 5,637
  • 2
  • 24
  • 35
1

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

alex-i
  • 5,406
  • 2
  • 36
  • 56