Skip to content
No description, website, or topics provided.
C++ C CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Initial commit Oct 23, 2019
stb Initial commit Oct 23, 2019
zxing Initial commit Oct 23, 2019
CMakeLists.txt Initial commit Oct 23, 2019
LICENSE Initial commit Oct 23, 2019
README.md Update README.md Oct 25, 2019
scan_image.cpp Initial commit Oct 23, 2019
test.png Initial commit Oct 23, 2019
wapm.toml Update wapm.toml Oct 25, 2019

README.md

ZXing Barcode Reader

The source code is ported from https://github.com/nu-book/zxing-cpp.

How to Build

Install wasi-sdk_7.0_amd64.deb .

Set environment variables in terminal:

export PATH=/opt/wasi-sdk/bin:$PATH
export CC=/opt/wasi-sdk/bin/clang
export CXX=/opt/wasi-sdk/bin/clang++

Build the project:

mkdir build
cd build
cmake ..
cmake --build .

Usage

Install wasmer, wasmtime or wapm.

Run zxing_barcode_reader.wasm:

wasmer

wasmer run zxing_barcode_reader.wasm --dir=<image folder> <PNG file>

wasmtime

wasmtime zxing_barcode_reader.wasm --dir=<image folder> <PNG file>

wapm

wapm install yushulx/zxing_barcode_reader
wapm run zxing_barcode_reader --dir=<image folder> <PNG file>

Blog

How to Build ZXing C++ to Wasm using WASI SDK in Linux

You can’t perform that action at this time.