ghiboz
ghiboz

Reputation: 8003

ios write geotag into image

I need to read a jpg image (not from the imagelibrary) and write into them the exif geotag data taken from the iPhone gps how can I do this?

thanks in advance.

Paolo

Upvotes: 2

Views: 2166

Answers (2)

Wayne Liu
Wayne Liu

Reputation: 1291

The UIImagePickerController doesn't give you the Camera's location. You have to add CLLocationManager in the app. Initiate/delegate to self. And call "startUpdatingLocation". Then in "-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation", you are able to get your location from "newLocation".

Now if you want to save the image to photo Library, you can use https://github.com/gpambrozio/GusUtils

More explanations can be found: http://blog.codecropper.com/2011/05/adding-metadata-to-ios-images-the-easy-way/

Upvotes: 1

ott--
ott--

Reputation: 5722

It seems that such a class does not exist yet. If you know Perl a bit, get ExifTool and read the source, it's not that hard (read the jpg as binary, insert the exif tags for geotag and write it back (the file will grow some bytes only).

Upvotes: 0

Related Questions