Objective-C - 将GPS信息添加到照片 [英] Objective-C - Adding GPS information to a photograph
问题描述
我现在用来保存图像的代码。
我想知道是否可以在将照片保存到相机胶卷时将GPS信息添加到照片中。是:
UIImage * theImage =(UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage];
UIImageWriteToSavedPhotosAlbum(theImage,self,
@selector(image:didFinishSavingWithError:contextInfo :),nil);
我在想如何修改图片EXIF数据来添加当前位置,并使其兼容在iPhone上使用'Places'功能。 解决方案
这个例子: http://caffeinatedcocoa.com/blog/?p=7 解释了如何更新照片的日期。转至 CGImageProperties参考资料,并执行同样用相关的GPS键代替示例中的键kCGImagePropertyExifDateTimeDigitized。我自己没有尝试过,但听起来像是应该起作用。 :)
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.
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. :)
这篇关于Objective-C - 将GPS信息添加到照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!