Open gekkedev opened 1 week ago
Apparently, the function expects not just base64, but a data URI.
https://github.com/wppconnect-team/wppconnect/blob/135805324b04479f2ea7811620525d8a750ca05a/src/api/helpers/base64-mimetype.ts#L24
Prefixing "data:image/png;base64,"
to the screenshot works. IMHO, it would be better to prefix it automatically and verify the actual image, or not at all. I'll create a PR to update the documentation and describe the workaround in the JSDoc here:
https://github.com/wppconnect-team/wppconnect/blob/135805324b04479f2ea7811620525d8a750ca05a/src/api/layers/sender.layer.ts#L224
Description
Images cannot be sent as picture As reference image, I'm taking a screenshot:
Environment
Steps to Reproduce
Log Output
sendImageFromBase64:
wrapping this in a try/catch structure yields this:
sendFileFromBase64:
Additional context / Screenshot
did not try it with other pictures yet, so there could be an issue with the screenshot creation function's output (although it is displayable)