5 releases

0.10.2 Jan 22, 2024
0.10.1 Mar 9, 2023
0.10.0 Jun 15, 2020
0.9.1 Jun 11, 2020
0.9.0 Jun 7, 2020

#186 in Images

Download history 600/week @ 2024-11-02 551/week @ 2024-11-09 601/week @ 2024-11-16 621/week @ 2024-11-23 592/week @ 2024-11-30 748/week @ 2024-12-07 659/week @ 2024-12-14 802/week @ 2024-12-21 938/week @ 2024-12-28 900/week @ 2025-01-04 817/week @ 2025-01-11 700/week @ 2025-01-18 521/week @ 2025-01-25 626/week @ 2025-02-01 808/week @ 2025-02-08 252/week @ 2025-02-15

2,293 downloads per month
Used in 3 crates

MIT license

81KB
2.5K SLoC

quircs

QR Scanner in Rust.


Ported from quirc.

Example

// open the image from disk
let img = image::open("tests/data/Hello+World.png").unwrap();

// convert to gray scale
let img_gray = img.into_luma();

// create a decoder
let mut decoder = quircs::Quirc::default();

// identify all qr codes
let codes = decoder.identify(img_gray.width() as usize, img_gray.height() as usize, &img_gray);

for code in codes {
    let code = code.expect("failed to extract qr code");
    let decoded = code.decode().expect("failed to decode qr code");
    println!("qrcode: {}", std::str::from_utf8(&decoded.payload).unwrap());
}

CLI Example

$ cargo build --release --example qrtest
$ qrtest <path-to-image>

Dependencies

~0.3–0.8MB
~19K SLoC