Camera plugin question


#1

On certain Android devices, our users are receiving an extra “selection” screen before being taken to the image gallery. See attached photo. Here is our code:

$scope.galleryPicture = function(){
        getPicture(navigator.camera.PictureSourceType.PHOTOLIBRARY);
    };

    var getPicture = function(source){
        var options = {
            quality : 50,
            destinationType : navigator.camera.DestinationType.FILE_URI,
            sourceType : source,
            encodingType: 0,
            correctOrientation: true,
            targetWidth: 600,
            targetHeight: 600
        };

        $cordovaCamera.getPicture(options).then(function(imageData){
            $scope.mypicture = imageData;
        }, function(err){
            errorService.showError("Failed to get picture, try again!!");
        });
    };

Could the source be the issue? Would switching to Camera.PictureSourceType.SAVEDPHOTOALBUM have a different effect? As I stated, this only happens on certain Androids.


#2

You should use SAVEDPHOTOALBUM to go around with this issue.
PHOTOLIBRARY is the whole “library”.


#3

Tried that and still no luck. I am thinking that I am going to have to modify the camera plugin to target a specific intent, unless someone else has another idea. Surprised this one doesn’t come up that often. Have been unable to find other people talking about this.


#4

We ran into this issue as we wanted to create something like a pdf-upload. On some device (Samsung…) you are able to choose your source what it makes a little bit difficult.

Now we provide only taking photos, upload photos, capture audio and video files instead of upload them from filesystem.