rxing-core / rxing

cRustacean Crossing
https://crates.io/crates/rxing
Apache License 2.0
198 stars 19 forks source link
barcode barcode-generator barcode-reader barcode-scanner code128 code39 code93 codea datamatrix datamatrix-generator datamatrix-scanner ean13 ean8 pdf417 qrcode qrcode-generator qrcode-scanner rust upc-a upc-e

rxing - cRustacean Crossing

This is a port of the ZXing (https://github.com/zxing/zxing) java barcode library to pure rust. Conversion was done by hand. Original license resides with the authors of zxing.

Porting of the testing library is incomplete. Currently all positive tests are implemented. Negative verfication tests are not implemented.

Porting was done with the rust language in mind, though some parts may resemble java more directly than a proper clean-sheet rust implementation. The process of "rustifying" the code is ongoing.

CLI

If you're looking for a CLI interface into the library, please see rxing-cli.

Online

An online demo is available at scan.rxing.org.

WASM

If you're looking for a WASM version of this library, check out rxing-wasm, or on NPM.

Minimum Rust Version

Currently building with a minimum rust version of 1.69. Versions below that are not tested and may not compile or run as expected.

Status

All barcode formats are tested and functioning in their current state against current tests.

Symbology Status Encode Decode
aztec complete yes yes
datamatrix complete yes yes
maxicode complete no yes
pdf417 complete yes yes
qrcode complete yes yes
coda complete yes yes
code 39 complete yes yes
code 93 complete yes yes
code 128 complete yes yes
itf complete yes yes
ean 8 complete yes yes
ean 13 complete yes yes
upc a complete yes yes
upc e complete yes yes
rss-14 complete no yes
rss-expanded complete no yes
telepen complete yes yes
micro qr complete no yes
rMQR complete no yes

Please note that currently UPC/EAN Extension 2/5 is supported.

Feature Flags

The following feature flags are available:

The default feature set includes the image, client_support, and image_formats features mentioned above.

Incomplete

The library has only been thurougly tested with the BufferedImageLuminanceSource source format. Using any other source is currently experimental and may result in unexpected or undefined outputs. This means that the feature flag used to enable the use of the image crate is currently on by default. The Luma8LuminanceSource is the second best tested library, and is the underpinning for the wasm based wrapper for the library. Consider Luma8LuminanceSource as a reasonable option if building the crate with the image feature turned off is desired.

Example with helpers

use rxing;

fn main() {
    let file_name = "test_image.jpg";

    let results = rxing::helpers::detect_multiple_in_file(file_name).expect("decodes");

    for result in results {
        println!("{} -> {}", result.getBarcodeFormat(), result.getText())
    }
}

Latest Release Notes

Known Issues

ZXing Track

Currently tracking zxing 3.5.1

Copyright notes

The original license / copyright remains with the zxing developers. The license / copyright for the ported components of the c++ port remain with the developers of that port, where applicable.