You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/08/14 22:32:21 UTC

[5/6] git commit: [CB-3482] Allow image metadata to be saved to album on iOS

[CB-3482] Allow image metadata to be saved to album on iOS

-pass in metadata when saving to album using ALAssetsLibrary


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/b702aaf4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/b702aaf4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/b702aaf4

Branch: refs/heads/master
Commit: b702aaf440c9c8ee0bd361e5dda5c7cc0a4a4476
Parents: 5f98661
Author: James Jong <wj...@gmail.com>
Authored: Fri Aug 9 10:09:42 2013 -0400
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 14 13:10:24 2013 -0700

----------------------------------------------------------------------
 src/ios/CDVCamera.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/b702aaf4/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index ebef288..e0f195f 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -675,7 +675,8 @@ static NSSet* org_apache_cordova_validArrowDirections;
     }
     
     if (self.pickerController.saveToPhotoAlbum) {
-        UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:[self data]], nil, nil, nil);
+        ALAssetsLibrary *library = [ALAssetsLibrary new];
+        [library writeImageDataToSavedPhotosAlbum:self.data metadata:self.metadata completionBlock:nil];
     }
     
     if (self.pickerController.returnType == DestinationTypeFileUri) {