sorry for necro this post, but i’ve searched and this post seemed the best place to ask…
I’ve been working with the cordova camera plugin lately with and without ng.cordova, and looks like the saveToPhotoAlbum setting is not working for me.
Working on android 4.4
If you, or anyone can help me to find the issue, i’d be very apreciated.
Of course @felipew , my code is the one provided by ngCordova.
$scope.takePicture = function() {
var options = {
quality : 80,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 640,
targetHeight: 640,
//popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: true,
correctOrientation: true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
// Success! Image data is here
$scope.data.foto = "data:image/jpeg;base64,"+imageData;
}, function(err) {
// An error occured. Show a message to the user
});
}
I’ve only tested it on android. And everything works right, except that the picture is not saved on the camera roll or anywhere apparently.
Also, as a side comment, even on a good phone, when i do <img src="$scope.data.foto"> with the base64 image, the app suffers a big performance loss. Any advices on this?
I’ve don’t checked it, but its very likely to be this.
I just downloaded the plugin via the CLI and didn’t check the app permissions.
I’ll try it this afternoon.