android - Cordova camera plugin: Photo is not displayed when taking a picture -


i'm using cordova camera plugin , have encountered problem.

when using : sourcetype: camera.picturesourcetype.photolibrary url: content://media/external/images/media/1517

when using url on <img ng-src="{{image}}" alt="description"/> works great

but when removing sourcetype , taking picture phone returned uri this: file:///storage/emulated/0/android/data/com.ionicframework.myapp/cache/1454450218633.jpg

and when uri returning image not displayed. ideas? on ionic framework , on android device.

some code taking picture:

   function takephoto() {      var defer = $q.defer();       navigator.camera.getpicture(function(imagedata) {        defer.resolve(imagedata);      }, function(err) {        defer.reject(err)      });       return defer.promise;    } 

this method being called from:

$scope.getimage = function() {   cameraservice.takephoto().then(function(imagedata){     console.log(imagedata);     $scope.image = imagedata;   }).catch(function(err){     console.log(err);   }) } 

and provider whitelist:

$compileprovider.imgsrcsanitizationwhitelist(/^\s*(https?|file|blob|cdvfile|content):|data:image\//); 

update:

i able done using camera.destinationtype.data_url isn't possible take file url , display image? again working when selecting photo library not when taking new one.

problem livereload feature. running application without livereload , able load picuters path


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -