Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71118

Camera options not work

$
0
0

@mcihak wrote:

Hi all,
I am trying to take a photo from front camera but function for it ignores this options (width and height too). Only options that work is "saveToPhotoAlbum". Can you please tell me what is wrong with my function?

takePhoto() {
    let options = {
        targetWidth: 380,
        targetHeight: 380,
        saveToPhotoAlbum: true,
        cameraDirection: 0
    };
    Camera.getPicture(options).then((imageData) => {
        // imageData is either a base64 encoded string or a file URI
        // If it's base64:
        let base64Image = 'data:image/jpeg;base64,' + imageData;
        console.log(base64Image);
    }, (err) => {
        // Handle error
    });
}

Thanks a lot.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71118

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>