You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/11/06 02:09:27 UTC

[jira] [Commented] (CB-9960) Images from Google Photos cause FileNotFoundException

    [ https://issues.apache.org/jira/browse/CB-9960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992847#comment-14992847 ] 

ASF GitHub Bot commented on CB-9960:
------------------------------------

GitHub user riknoll opened a pull request:

    https://github.com/apache/cordova-plugin-camera/pull/135

    CB-9960 android: Fixed FileNotFoundException for some gallery images

    Certain gallery applications (such as Google Photos) return `content://` URIs that our method of getting a file path (`FileHelper.getRealPath()`) fails to properly dereference. Using these applications with `cameraOptions` that cause the image to be edited (width/height, correctOrientation, allowEdit, etc.) would trigger a FileNotFoundException and cause the plugin to fail because it is unable to grab the original filename. This checks the result of `FileHelper.getRealPath()` and if it fails to grab a path instead uses the generic filename "modified.jpg" for the local file (which was the intended behavior before, we were just checking the result of `getRealPath()` incorrectly). Note: These images will lose their EXIF data (the Exifinterface needs a local file path, I think)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-camera CB-9960

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-camera/pull/135.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 #135
    
----
commit 338785b527e9a767fe717f95c920cda69e203ef6
Author: riknoll <ri...@gmail.com>
Date:   2015-11-05T23:03:35Z

    CB-9960 android: Fixed FileNotFoundException for some gallery images

----


> 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-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org