mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:42:52 +08:00
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
This commit is contained in:
parent
ad8788a5e6
commit
bf935dfbd2
@ -943,7 +943,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
|
|||||||
try {
|
try {
|
||||||
fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
|
fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova);
|
||||||
image = BitmapFactory.decodeStream(fileStream);
|
image = BitmapFactory.decodeStream(fileStream);
|
||||||
} finally {
|
} catch (OutOfMemoryError e) {
|
||||||
|
callbackContext.error(e.getLocalizedMessage());
|
||||||
|
} catch (Exception e){
|
||||||
|
callbackContext.error(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
finally {
|
||||||
if (fileStream != null) {
|
if (fileStream != null) {
|
||||||
try {
|
try {
|
||||||
fileStream.close();
|
fileStream.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user