You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/03/28 18:02:56 UTC

[3/5] android commit: CB-1796: Let's make sure we actually write the file instead of just writing EXIF to NOTHING

CB-1796: Let's make sure we actually write the file instead of just writing EXIF to NOTHING


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

Branch: refs/heads/master
Commit: b7bb72294ab06137e4a409904963ce442e32c341
Parents: 64ff204
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Mar 27 15:11:11 2013 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Thu Mar 28 10:02:02 2013 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/CameraLauncher.java     |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b7bb7229/framework/src/org/apache/cordova/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java
index 9473828..03b7712 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -312,10 +312,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
 
                     // If sending filename back
                     else if (destType == FILE_URI || destType == NATIVE_URI) {
-                        if (!this.saveToPhotoAlbum) {
-                            uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg"));
+                        if (this.saveToPhotoAlbum) {
+                            Uri inputUri = getUriFromMediaStore();
+                            //Just because we have a media URI doesn't mean we have a real file, we need to make it
+                            uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova)));
                         } else {
-                            uri = getUriFromMediaStore();
+                            uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg"));
                         }
 
                         if (uri == null) {