cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-9960) Images from Google Photos cause FileNotFoundException
Date Fri, 06 Nov 2015 01:09:27 GMT


ASF GitHub Bot commented on CB-9960:

GitHub user riknoll opened a pull request:

    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 CB-9960

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

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 <>
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:
>             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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message