[ https://issues.apache.org/jira/browse/CB-9960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15108778#comment-15108778 ]
ASF GitHub Bot commented on CB-9960: ------------------------------------ GitHub user MiniGab opened a pull request: https://github.com/apache/cordova-plugin-camera/pull/155 Fix FileNotFoundException in ouputModifiedBitmap The ouputModifiedBitmap expect the result from FileHelper.getRealPath to return null in case of error : String realPath = FileHelper.getRealPath(uri, this.cordova); // if realPath == "" => fileName = "" String fileName = realPath != null ? realPath.substring(realPath.lastIndexOf('/') + 1) : "modified." + (this.encodingType == JPEG ? "jpg" : "png"); String modifiedPath = getTempDirectoryPath() + "/" + fileName; OutputStream os = new FileOutputStream(modifiedPath); <-- error when fileName == "" This might be related to https://issues.apache.org/jira/browse/CB-9960 and https://issues.apache.org/jira/browse/CB-10093 You can merge this pull request into a Git repository by running: $ git pull https://github.com/MiniGab/cordova-plugin-camera master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-camera/pull/155.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #155 ---- commit 9ea6d47225024890f251688a437d43c892b97a97 Author: Gabriel <mini...@users.noreply.github.com> Date: 2016-01-20T15:21:09Z Update FileHelper.java Fix FileNotFoundException when opening a file from a third party application ---- > Images from Google Photos cause FileNotFoundException > ----------------------------------------------------- > > Key: CB-9960 > URL: https://issues.apache.org/jira/browse/CB-9960 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Camera > Environment: Android 6.0, cordova-android 5.0.0 (dev), > cordova-plugin-camera 1.2.1 (dev) > Reporter: Richard B Knoll > Assignee: Richard B Knoll > Labels: android > > When selecting images from the PHOTOLIBRARY source using the Google Photos > application a FileNotFoundException is thrown if any flags that cause image > edits are turned on (width/height, allowEdit, correctOrientation, etc.). The > issue is that our method for dereferencing content URIs in FileHelper fails > for the content URI returned by Google Photos and returns an empty path (that > {{ouputModifiedBitmap()}} tries to grab a filename from) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org