0

I am developing a camera application which can be used to take pictures and save them in a separate album. I used photos framework to save images and now I need to save GPS data (location where the picture is taken) with the picture (may be in metadata). I searched for any method to do this thing using photos framework but I failed, I couldn't find anything related. Any help would be highly appreciated.

This is the peace of code I used to save pictures

[[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
    {

    }

}];
GMHSJ
  • 694
  • 3
  • 10
  • 29

1 Answers1

0

I assume you want the latitude & longitude. Have you tried the location property of PHAsset class?

jarora
  • 4,876
  • 2
  • 33
  • 44
  • I can access exif data but couldn't find a way to save. – GMHSJ Sep 24 '15 at 13:56
  • http://stackoverflow.com/questions/9766394/get-exif-data-from-uiimage-uiimagepickercontroller Does this help? – jarora Sep 29 '15 at 08:04
  • Using AssertLibrary it is possible. I know that. I want to do it using photos framework since AsserLibrary is deprecated from ios 9 or 8 as i remember. – GMHSJ Sep 29 '15 at 09:05
  • http://stackoverflow.com/questions/24462112/ios-8-photos-framework-access-photo-metadata – jarora Sep 30 '15 at 11:35
  • I will try this Jarora. Thanks for your responce (Y) – GMHSJ Oct 30 '15 at 11:27