Open vanthienpc opened 9 years ago
I am facing the same issue
Are you running the application in live reload mode, right ? If true then you should add this line below config part of app.js $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|content|file|assets-library):|data:image\//);
And after that, run app at normal mode. It'll work well
I spent some time looking at it further, and realized i only have the file URI problem when the photos are from SD card. If the photo is saved into the phone, then it has no problem. So there is no problem on IOS, but on Android.
+1
Hi @vanthienpc, @clarklight @pavanputhra u should use window.resolveLocalFileSystemURI() to show images. Here how i handle it This is select function :
window.imagePicker.getPictures(gallerySuccess, galleryError, { maximumImagesCount : 1, width : 462, height : 462 /* BTW : this options (width, height) not working */ });
When selected photos returned to success function :
Gallery Success :
function(results){
window.resolveLocalFileSystemURI(results[0], onResolveSuccess, onResolveFail);
}
Resolve Success :
function(fileEntry){
fileEntry.file(function(file){
U will use file.LocalURL for show image
}
}
I am using file method for insert file objects to database. If u don't need inserting, just use fileEntry.fullPath. Good Luck.
I have the same problem.Do you have a solution?
I just test on Android 4.4.
When I choose a picture from gallery. It's return image source but I can't display image on view as expect. It show blank space instead of show image
file path return: file:///data/data..../name.jpg
Anyone help me find out the way to show it. I'll really appreciate
Thanks