Function draw_png

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

Draw text to a 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.