You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "breautek (via GitHub)" <gi...@apache.org> on 2023/09/06 12:30:32 UTC
[GitHub] [cordova-plugin-camera] breautek commented on issue #327: Image as base64 to style background-image:url() issue
breautek commented on issue #327:
URL: https://github.com/apache/cordova-plugin-camera/issues/327#issuecomment-1708255351
Cannot reproduce on modern versions
```
document.body.onclick = () => {
navigator.camera.getPicture((e) => {
console.log(e);
document.body.style.backgroundImage = `url("data:;base64,${e}")`;
}, (e) => {
console.error(e);
}, {
destinationType: navigator.camera.DestinationType.DATA_URL
});
};
```
Also works if you specify the JPEG mimetype, but you'll need to guarentee if the data is an actual jpeg encoded image.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org