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

#108 in Images

Download history 904/week @ 2024-05-19 860/week @ 2024-05-26 765/week @ 2024-06-02 726/week @ 2024-06-09 717/week @ 2024-06-16 694/week @ 2024-06-23 701/week @ 2024-06-30 706/week @ 2024-07-07 714/week @ 2024-07-14 981/week @ 2024-07-21 1376/week @ 2024-07-28 1260/week @ 2024-08-04 1205/week @ 2024-08-11 853/week @ 2024-08-18 859/week @ 2024-08-25 733/week @ 2024-09-01

3,824 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.4–0.9MB
~20K SLoC