-
Notifications
You must be signed in to change notification settings - Fork 67
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
can I use this in a web application? #53
Comments
You can... I used it with seed: https://pslink.teilgedanken.de/app/ (user+passwd demo) |
@enaut I see thanks mate |
No problem it took me quite some time to figure everything out. So I'm glad if that code can help someone to reduce that time for them :) |
Alternative to @enaut's fn qrcode_png(content: &String) -> Vec<u8> {
let qrcode = QrCode::new(content).unwrap();
let image: image::ImageBuffer<Luma<u8>, Vec<u8>> = qrcode.render::<Luma<u8>>().build();
let mut buf: Vec<u8> = Vec::new();
let wd: u32 = image.width();
let ht: u32 = image.height();
let encoder: PngEncoder<&mut Vec<u8>> = PngEncoder::new(&mut buf);
encoder.encode(&image.into_raw(), wd, ht, ColorType::L8).expect("Cannot encode image");
buf
} You could return this as a response body, for instance. |
Hi, I wanted to ask you, I wanted to make a web application that uses
qrcode-rust
library. Is it possible for me to compile it to wasm and this will work ok?The text was updated successfully, but these errors were encountered: