Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPicture did not work on my Samsung Tab A7 Lite #807

Open
gpspremsun opened this issue Sep 16, 2022 · 0 comments
Open

getPicture did not work on my Samsung Tab A7 Lite #807

gpspremsun opened this issue Sep 16, 2022 · 0 comments

Comments

@gpspremsun
Copy link

gpspremsun commented Sep 16, 2022

I just found that getPicture did not work on my Samsung Tab A7 Lite (One UI 4.1 with Android 12) but all other devices I have (both android/ios on variety os version include One UI 4.1 with Android 12 on other devices)

Normally I got base64 string were returned to my application after I take a photo but for my new tested Samsung Tab A7 Lite device I got an error like "No Image Selected" immediately after camera was opened

I notice that after getPicture was called normally my application would open camera function under itself but on my new tested Samsung Tab A7 Lite seem it call Samsung stock Camera app separately instead.

currently I user cordova-plugin-camera 4.1.0 under Cordova 9.0 for my Android development and below is code I have in my application...

function onCamSuccessBase64(imageData) {
var i = new Image();
i.onload = function () {
intFileBase64Width = parseInt(i.width);
intFileBase64Height = parseInt(i.height);
strFileBase64 = imageData;
showConfirm();
};
i.src = "data:image/jpeg;base64," + imageData;
}

function onCamFail(message) {
alert("Failed because: " + message);
}

function photo_take() {
navigator.camera.getPicture(onCamSuccessBase64, onCamFail, {
quality: 30, targetWidth: 864, targetHeight: 1536,
allowEdit: false, correctOrientation: true, destinationType: Camera.DestinationType.DATA_URL
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant