Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting location #8

Open
osklar0328 opened this issue May 8, 2014 · 0 comments
Open

Getting location #8

osklar0328 opened this issue May 8, 2014 · 0 comments

Comments

@osklar0328
Copy link

I managed to get the current location of a photo that is taken with the iPhone camera but how can I get the location of a photo that was chosen from the library? Is this possible to do this, as for now when I choose a photo from the library it's location is set to the current location and not where the photo was taken.

in:

imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

I use this to get location of the photo taken with the camera:

NSMutableDictionary *metadata = [[NSMutableDictionary alloc] initWithDictionary:[info objectForKey:UIImagePickerControllerMediaMetadata]];
[metadata setLocation:currentLocation];
NSLog(@"Metadata location for taken photo:\n%@", metadata.location);

The log says:

Metadata location for taken photo:
<+55.60409927,+12.99382114> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2014-05-08 kl. 10:55:12 Centraleuropa, sommartid

But when i use:

NSMutableDictionary *metadata = [[NSMutableDictionary alloc] initWithInfoFromImagePicker:info];
NSLog(@"Metadata for chosen photo:\n%@", metadata);

The log says:
Metadata for chosen photo:
{
}

could you help me understand how to use your category properly for images chosen from the library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant