GusUtils icon indicating copy to clipboard operation
GusUtils copied to clipboard

Getting location

Open osklar0328 opened this issue 10 years ago • 0 comments

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?

osklar0328 avatar May 08 '14 08:05 osklar0328