From issues-return-92443-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Thu Feb 8 13:13:07 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E69FD18064F for ; Thu, 8 Feb 2018 13:13:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D6E4D160C5D; Thu, 8 Feb 2018 12:13:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2850A160C3D for ; Thu, 8 Feb 2018 13:13:07 +0100 (CET) Received: (qmail 555 invoked by uid 500); 8 Feb 2018 12:13:06 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 542 invoked by uid 99); 8 Feb 2018 12:13:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2018 12:13:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D06041A0626 for ; Thu, 8 Feb 2018 12:13:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id JhhCc63qIBZv for ; Thu, 8 Feb 2018 12:13:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 071495FB92 for ; Thu, 8 Feb 2018 12:13:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E127AE00E0 for ; Thu, 8 Feb 2018 12:13:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id C9F1A24126 for ; Thu, 8 Feb 2018 12:13:00 +0000 (UTC) Date: Thu, 8 Feb 2018 12:13:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-13415) Importing corrupt images using the Camera plugin crashes the app MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-13415?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D163568= 66#comment-16356866 ]=20 ASF GitHub Bot commented on CB-13415: ------------------------------------- jcesarmobile closed pull request #309: CB-13415 (android) Importing corrupt= images using the Camera plugin c=E2=80=A6 URL: https://github.com/apache/cordova-plugin-camera/pull/309 =20 =20 =20 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.j= ava index a8e6fc43..fbe8470e 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -943,7 +943,12 @@ private Bitmap getScaledAndRotatedBitmap(String imageU= rl) throws IOException { try { fileStream =3D FileHelper.getInputStreamFromUriString(imag= eUrl, cordova); image =3D BitmapFactory.decodeStream(fileStream); - } finally { + } catch (OutOfMemoryError e) { + callbackContext.error(e.getLocalizedMessage()); + } catch (Exception e){ + callbackContext.error(e.getLocalizedMessage()); + } + finally { if (fileStream !=3D null) { try { fileStream.close(); =20 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > Importing corrupt images using the Camera plugin crashes the app > ---------------------------------------------------------------- > > Key: CB-13415 > URL: https://issues.apache.org/jira/browse/CB-13415 > Project: Apache Cordova > Issue Type: Bug > Components: cordova-plugin-camera > Environment: Android: OS 7.0, Phone Model: Moto G5 Plus > iOS: OS 10.1.1 (14B150) > Reporter: Shemrick Flannigan > Priority: Critical > Labels: android, camera, cameraui, ios > > ISSUE > Importing corrupt images using the Camera plugin crashes the app > Current Behavior > # Importing a corrupt image using the Cordova Camera plugin crashes the C= ordova app which uses the plugin > Expected Behavior > # Importing a corrupt image using the Cordova Camera plugin: > #* Throws an exception which can be caught by the Cordova app which uses = the plugin > #* Does not crash the Cordova app which uses the plugin > #* Allows the Cordova app which uses the plugin to render a Toast error m= essage relaying the error > # # Platforms affected > #* Android > #* iOS > REFERENCES > # [Sample corrupt image which crashes the app | https://www.dropbox.com/s= /e7dz007svtvscbc/Corrupt_Image_4.7MB_13500x13500.D2.jpg?dl=3D0] > # [Technique used to wrap the call in a Try/Catch block in a callable inn= er class to prevent an app crash | https://stackoverflow.com/questions/1918= 3174/phonegap-video-capture-crashes]=20 > ADDITIONAL INFORMATION > # Importing corrupt images does not crash apps which do not use the Camer= a plugin, such as: > #* Yelp mobile app > #* Slack mobile app -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org