Github user FuzzyTree commented on the pull request:

    
https://github.com/apache/cordova-plugin-camera/pull/99#issuecomment-176045492
  
    Debugging shows that `FileHelper.getRealPath` returns an empty (non-null) 
string, which causes the function to return a directory name instead of a file 
name.
    
    `/storage/emulated/0/Android/data/com.ionicframework.ws938141/cache: open 
failed: EISDIR (Is a directory)`
    
            // Some content: URIs do not map to file paths (e.g. picasa).
            String realPath = FileHelper.getRealPath(uri, this.cordova);
            // Get filename from uri
            String fileName = realPath != null ?
                realPath.substring(realPath.lastIndexOf('/') + 1) :
                "modified." + (this.encodingType == JPEG ? "jpg" : "png");
    
    Adding a check for empty string fixed the issue for me
    
        String fileName = (realPath != null && !realPath.isEmpty()) ?
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to