From 3b8f64e330df7f1b9d5088fd1a3f7f3e6193c83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Ballesteros=20del=20Val?= Date: Wed, 28 Jun 2017 16:38:45 +0200 Subject: [PATCH] CB-12964: (android) Fix of bug when Pictures folder did not exist. If someone had removed Pictures folder in android, plugin failed trying to move there the new photo. This happened because plugin did not check the existence of this folder, and if not, it did not complete the folder tree. This closes #273 --- src/android/CameraLauncher.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index c61121e..0f9b4b0 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -601,6 +601,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect String imageFileName = "IMG_" + timeStamp + (this.encodingType == JPEG ? ".jpg" : ".png"); File storageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES); + storageDir.mkdirs(); String galleryPath = storageDir.getAbsolutePath() + "/" + imageFileName; return galleryPath; }