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

This commit is contained in:
Joe Bowser 2013-03-27 15:11:11 -07:00
parent 64ff204371
commit b7bb72294a

View File

@ -312,10 +312,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
// If sending filename back // If sending filename back
else if (destType == FILE_URI || destType == NATIVE_URI) { else if (destType == FILE_URI || destType == NATIVE_URI) {
if (!this.saveToPhotoAlbum) { if (this.saveToPhotoAlbum) {
uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg")); 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 { } else {
uri = getUriFromMediaStore(); uri = Uri.fromFile(new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), System.currentTimeMillis() + ".jpg"));
} }
if (uri == null) { if (uri == null) {