ios 将地理标签写入图像
我需要读取 jpg 图像(不是来自图像库) 并将从 iPhone GPS 获取的 exif 地理标记数据写入其中 我该怎么做?
提前致谢。
保罗
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UIImagePickerController 不会为您提供相机的位置。您必须在应用程序中添加 CLLocationManager。发起/委托给自己。并调用“startUpdatingLocation”。然后在“-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation”中,您可以从“newLocation”获取您的位置。
现在,如果要将图像保存到照片库,可以使用 https://github.com/gpambrozio/GusUtils< /a>
更多解释可参见:http://blog.codecropper.com/ 2011/05/将元数据添加到 ios-images-the-easy-way/
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/
好像这样的类还不存在。如果您了解一点 Perl,获取 ExifTool 并读取源代码,这并不难(将 jpg 作为二进制读取,插入地理标记的 exif 标记并将其写回(文件只会增长一些字节)。
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).