开发者

ios write geotag into image

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

thanks in advance.

Paolo


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/


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜