概述
JAB码是德国Fraunhofer SIT(去官网)开发的一种二维码,看起来像彩色QR code,官网说2022年就要变成ISO标准了,且与传统的黑白二维码相比,相同尺寸下可以承载更多信息(毕竟有颜色信息嘛),而且更安全。
线上测试编码和解码看这里:https://jabcode.org/
本地引用
编译
修改三个makefile,加上-no-pie,然后在含makefile的路径下sudo make。
以防万一,可以先执行sudo make clean。
顺序是:jabcode -> jabcodeWriter -> jabcodeReader
使用
jabcode/src/jabcodeWriter/bin$ ./jabcodeWriter --help
=========================================
jabcodeWriter (Version 2.0.0 Build date: Aug 24 2020) - Fraunhofer SIT
Usage:
jabcodeWriter --input message-to-encode --output output-image [options]
--input Input data (message to be encoded).
--input-file Input data file.
--output Output image file.
--color-number Number of colors (4,8,default:8).
--module-size Module size in pixel (default:12 pixels).
--symbol-width Master symbol width in pixel.
--symbol-height Master symbol height in pixel.
--symbol-number Number of symbols (1-61, default:1).
--ecc-level Error correction levels (1-10, default:3(6%)). If
different for each symbol, starting from master and
then slave symbols (ecc0 ecc1 ecc2...). For master
symbol, level 0 means using the default level, for
slaves, it means using the same level as its host.
--symbol-version Side-Version of each symbol, starting from master and
then slave symbols (x0 y0 x1 y1 x2 y2...).
--symbol-position Symbol positions (0-60), starting from master and
then slave symbols (p0 p1 p2...). Only required for
multi-symbol code.
--color-space Color space of output image (0:RGB,1:CMYK,default:0).
RGB image is saved as PNG and CMYK image as TIFF.
--help Print this help.
Example for 1-symbol-code:
jabcodeWriter --input 'Hello world' --output test.png
Example for 3-symbol-code:
jabcodeWriter --input 'Hello world' --output test.png --symbol-number 3 --symbol-position 0 3 2 --symbol-version 3 2 4 2 3 2
=========================================
/jabcodeReader/bin/jabcodeReader --help
jabcodeReader (Version 2.0.0 Build date: Aug 24 2020) - Fraunhofer SIT
Usage:
jabcodeReader input-image(png) [--output output-file]
--output Output file for decoded data.
--help Print this help.
=========================================