yushulx/zxing_barcode_reader - wapm
Wapm logo
search

The search results will appear here

yushulx/zxing_barcode_readerWASI

0.1.5 Public • Published a month ago991.82 KB

A barcode reader app built with ZXing C/C++ and wasi-sdk

Copy and paste to install this package
wapm install yushulx/zxing_barcode_reader

launchGithub (grade - call_split - error_outline - open issues/PRs)

ZXing Barcode Reader

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

How to Build

Install wasi-sdk7.0amd64.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