Objective-C - 将 GPS 信息添加到照片中
我想知道将项目保存到相机胶卷时是否可以将 GPS 信息添加到照片中。
我当前用于保存图像的代码是:
UIImage *theImage = (UIImage *)[info objectForKey: UIImagePickerControllerOriginalImage];
UIImageWriteToSavedPhotosAlbum(theImage, self,
@selector(image:didFinishSavingWithError:contextInfo:), nil);
我想知道如何修改图像 EXIF 数据以添加当前位置,并使其与 iPhone 上的“地点”功能兼容。
I am wondering if it is possible to add GPS information to a photograph when saving the item to the camera roll.
The code I currently use to save the image is:
UIImage *theImage = (UIImage *)[info objectForKey: UIImagePickerControllerOriginalImage];
UIImageWriteToSavedPhotosAlbum(theImage, self,
@selector(image:didFinishSavingWithError:contextInfo:), nil);
I am wondering how I can modify the image EXIF data to add the current location, and make it compatible with the 'Places' functionality on the iPhone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此示例:http://caffelatedcocoa.com/blog/?p=7 解释了如何更新照片的日期。转到 CGImageProperties 参考 并执行同样将示例中的 kCGImagePropertyExifDateTimeDigitized 密钥替换为相关 GPS 密钥。我自己还没有尝试过,但听起来应该可行。 :)
This example: http://caffeinatedcocoa.com/blog/?p=7 explains how to update the date of a photo. Go to CGImageProperties Reference and do the same replacing the key kCGImagePropertyExifDateTimeDigitized of the example with the relevant GPS keys. I haven't try this myself, but sounds like it should work. :)