From d1932ad473f9673601799161a19e6c1aa6adfed8 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Wed, 27 Mar 2013 15:11:11 -0700 Subject: [PATCH] CB-1796: Let's make sure we actually write the file instead of just writing EXIF to NOTHING --- framework/src/org/apache/cordova/CameraLauncher.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java index e0e61ee5..22a9b948 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) {