简体   繁体   English

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

[英]Objective-C - Adding GPS information to a photograph

I am wondering if it is possible to add GPS information to a photograph when saving the item to the camera roll. 我想知道将项目保存到相机胶卷时是否可以向照片添加GPS信息。

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. 我想知道如何修改图像EXIF数据以添加当前位置,并使它与iPhone上的“位置”功能兼容。

This example: http://caffeinatedcocoa.com/blog/?p=7 explains how to update the date of a photo. 此示例: http : //caffeinatedcocoa.com/blog/?p=7说明了如何更新照片的日期。 Go to CGImageProperties Reference and do the same replacing the key kCGImagePropertyExifDateTimeDigitized of the example with the relevant GPS keys. 转到CGImageProperties Reference并执行相同的操作,用相关的GPS密钥替换示例中的kCGImagePropertyExifDateTimeDigitized密钥。 I haven't try this myself, but sounds like it should work. 我自己还没有尝试过,但是听起来应该可以。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM