Objective-C - 将 GPS 信息添加到照片中

发布于 2024-12-10 06:47:35 字数 395 浏览 0 评论 0原文

我想知道将项目保存到相机胶卷时是否可以将 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2024-12-17 06:47:35

此示例: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. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文