【问题标题】:How to save GPS data with a taken photo in ios如何在ios中保存带有拍摄照片的GPS数据
【发布时间】:2015-09-08 10:06:37
【问题描述】:

我正在开发一个相机应用程序,它可以用来拍照并将它们保存在单独的相册中。我使用照片框架来保存图像,现在我需要将 GPS 数据(拍摄照片的位置)与图片(可能在元数据中)一起保存。我使用照片框架搜索了任何方法来做这件事,但我失败了,我找不到任何相关的东西。任何帮助将不胜感激。

这是我用来保存图片的和平码

[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{

    PHAssetChangeRequest *assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:capturedImage];

    placeholder = [assetRequest placeholderForCreatedAsset];

    photosAsset = [PHAsset fetchAssetsInAssetCollection:Album options:nil];

    PHAssetCollectionChangeRequest *albumChangeRequest = [PHAssetCollectionChangeRequest changeRequestForAssetCollection:Album                                                assets:photosAsset];

    [albumChangeRequest addAssets:@[placeholder]];

} completionHandler:^(BOOL success, NSError *error) {

    if (success)
    {

    }
    else
    {

    }

}];

【问题讨论】:

    标签: ios objective-c gps metadata photosframework


    【解决方案1】:

    我假设您想要纬度和经度。你试过 PHAsset 类的 location 属性吗?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    相关资源
    最近更新 更多