cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FuzzyTree <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request: Try to use realpath filename i...
Date Thu, 28 Jan 2016 08:07:26 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message