Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova camera saves to gallery even on false

I'm in a really nasty situation...

My client wants a Cordova application in Ionic Framework v1, and it's imperative that the camera does not save images to gallery. However, when I set the parameter for saving to gallery to false, it is still saving to gallery.

The problem occurs on Android when you take a photo and cancel it. It then saves that picture to gallery and sometimes even saves all other pictures after that.

I would really welcome any kind of help; All I've found so far are some solutions that I find really hard to understand since my knowledge of Java is zero.

Here is my JS code

function capturePhoto() {
    var maxDimension = 1280;
    var options = {
      quality: 80,
      destinationType: Camera.DestinationType.DATA_URL,
      sourceType: Camera.PictureSourceType.CAMERA,
      correctOrientation: true,
      targetWidth: maxDimension,
      targetHeight: maxDimension,
      saveToPhotoAlbum: false

    };

This is for camera options.

 $cordovaCamera.getPicture(options).then(function (imageData) {
      var src = "data:image/jpeg;base64," + imageData;
      $scope.photoPreviewSrc = src;
    }).catch(function (err) {

    });
  }
like image 306
revan1990 Avatar asked Oct 28 '16 18:10

revan1990


1 Answers

I have checked with your code using cordova. It works fine as expected. Verify your app in other device once.

I haven't checked it on ionic platform.

like image 52
bvakiti Avatar answered Oct 03 '22 18:10

bvakiti