Function draw_base64

Source
pub fn draw_base64(text: &str) -> Result<String, String>
Expand description

Draw text to a Base64-encoded PNG QR code.

§Errors

This will return an error in case the URL gets too long to encode into a QR code. This would require the get_url method to generate an url bigger than 2000 characters, Which would be too long for some browsers anyway.

It will also return an error in case it can’t encode the qr into a png. This shouldn’t happen unless either the qrcode library returns malformed data, or the image library doesn’t encode the data correctly.