You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2018/02/08 12:12:19 UTC

[cordova-plugin-camera] branch master updated: CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)

This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-camera.git


The following commit(s) were added to refs/heads/master by this push:
     new bf935df  CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)
bf935df is described below

commit bf935dfbd2c2a991f6632424243a26858584821b
Author: Alpesh Patel <al...@gmail.com>
AuthorDate: Thu Feb 8 17:42:16 2018 +0530

    CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)
    
    * CB-13415 (android) Importing corrupt images using the Camera plugin crashes the app
---
 src/android/CameraLauncher.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index a8e6fc4..fbe8470 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -943,7 +943,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
             try {
                 fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
                 image = BitmapFactory.decodeStream(fileStream);
-            } finally {
+            }  catch (OutOfMemoryError e) {
+                callbackContext.error(e.getLocalizedMessage());
+            } catch (Exception e){
+                callbackContext.error(e.getLocalizedMessage());
+            }
+            finally {
                 if (fileStream != null) {
                     try {
                         fileStream.close();

-- 
To stop receiving notification emails like this one, please contact
jcesarmobile@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org