3

When I take the picture using the UIImagePickerController I get the info dictionary in the delegate method call didFinishPickingMediaWithInfo.... that does not provide any information on the location of the image...

I want to be able to embed the location where the image was taken and possibly even the heading... How can I save the image with the location embedded in it as well?

zumzum
  • 17,984
  • 26
  • 111
  • 172

2 Answers2

2

iOS strips the geolocation data from images. You will have to use CoreLocation to replace the stripped data. See the following.

Community
  • 1
  • 1
diatrevolo
  • 2,782
  • 26
  • 45
  • The problem is that there is no such key in the dictionary I get from the delegate. the first log prints out the info dictionary, but the second log prints out null... so it seems like the key "UIImagePickerControllerReferenceURL" does not exist... - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSLog(@"UIImagePicker did finish pickingMedia info dict: %@", info); NSLog(@"UIImagePickerControllerReferenceURL--> %@", [info objectForKey:@"UIImagePickerControllerReferenceURL"]); } Any suggestion? – zumzum Feb 22 '12 at 23:19
  • @Blip added an equivalent link. – diatrevolo Jul 06 '15 at 17:04
0

Look at RonC's answer here: UIImagePickerController and extracting EXIF data from existing photos

This shows how to get the location / date from the ALAssetLibrary API. For photos taken by the camera I haven't found a ready-made solution yet but clearly you can just use your own CLLocationManager to fetch the current location.

Community
  • 1
  • 1
n13
  • 6,843
  • 53
  • 40