Camera options not work

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.

If you put in 0 you want to use the back camera, a 1 would stand for the front camera. See the documentation for Cordova Image Plugin here!

ah. Ok, tried but not working. But it is bug on android:
Android Quirks
Any cameraDirection value results in a back-facing photo.

So this is ok, but targetWidth and Height still not work…

@mcihak Have you found solution? Is cameraDirection works on your device?

@saimon I need little help.

https://github.com/apache/cordova-plugin-camera#cameradirection--enum this GitHub cordova-plugin-camera docs says in order to open FRONT camera use integer1’.

And what ionic-native camerav2 docs https://ionicframework.com/docs/v2/native/camera/#CameraOptions
says is for FRONT camera use integer '0' (camera.d.ts file says the same).

I’m confused, I tried both options cameraDirection: 0 and cameraDirection: 1.
And while running on android MOTO G4 device it opens back camera.

I also tried this one… cameraDirection: Camera.Direction.FRONT. But it opens back camera.

Can you help me out of this?

Thanks in advance…

No, this is android bug from git documentation

Yes right, @mcihak.

I went through documentation, at this link https://github.com/apache/cordova-plugin-camera#android-quirks-1 the first line says the all. :frowning:

Is there any other option to do this so?

I am currently still having this problem on both IOS and Android. Is there any fix or work around for it? Thanks.

Yes,I am also tried its not working.Can u please help me for that issue @IonicDevScott