I am using the Cordova Filechooser plugin to select files from my Android device. The plugin returns a content:// URI (e.g. content://com.android.providers.media.documents/document/image%3A15756). I am making a call to resolveLocalFileSystemURI in order to be able to resolve the content URL and draw the image on a canvas. However for some reason the URI isn't being resolved properly.
E.g. The returned entry's fullPath is /com.android.providers.media.documents/document/image%3A15756 for the content URI content://com.android.providers.media.documents/document/image%3A15756
Any ideas? My code is as follows:
window.resolveLocalFileSystemURI(_this.target_image, function (fileEntry) {
var img = new Image();
alert(fileEntry.fullPath);
img.src = URL.createObjectURL(fileEntry.fullPath);
img.onload = function() {
combiner_context.drawImage(img, 0, 0);
combiner_context.putImage(0, img.height, _that.editor_img);
};
}, function () {
alert('Could not load selected file. Please try again.');
});