[
https://issues.apache.org/jira/browse/CB-9960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992854#comment-14992854
]
ASF GitHub Bot commented on CB-9960:
------------------------------------
Github user jasongin commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-camera/pull/135#discussion_r44093297
--- Diff: src/android/CameraLauncher.java ---
@@ -547,7 +547,7 @@ private String ouputModifiedBitmap(Bitmap bitmap, Uri
uri) throws IOException {
String realPath = FileHelper.getRealPath(uri, this.cordova);
// Get filename from uri
- String fileName = realPath != null ?
+ String fileName = realPath != null && !realPath.isEmpty() ?
--- End diff --
This is fine, but you may also consider [TextUtils.isEmpty(realPath)]
(http://developer.android.com/reference/android/text/TextUtils.html#isEmpty(java.lang.CharSequence))
-- that is the recommended way in Android to check if a string is null or
empty.
> 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: [email protected]
For additional commands, e-mail: [email protected]