libqrencode

ダウンロード

最新版

開発版

開発版のソースをgithubで公開しています。

概要

libqrencode は QR コードを生成するための C ライブラリです。 QR コードは二次元バーコードの一種で、数字なら最大約7000桁、 英数字だと最大約4000字を埋め込むことができ、また誤り訂正能力に優れています。

サンプル

本ライブラリは以下の特徴があります。

仕様

libqrencode は JIS X0510:2004 で規定される、QR コード モデル2 を生成します。ただし、JIS X0510:2004 の規定のうち以下に挙げる項目については、 対応していません。

インストール

必要事項

一部のテストプログラムやユーティリティは SDL や PNG ライブラリを必要としますが、ライブラリ自体はそれらなしに使うことができます。 Microsoft Windows 上でのコンパイルには、Cygwin などの UNIX 的環境が必要となるでしょう。

コンパイルとインストール

単純に

./configure
make
make install

でインストールできる筈です。ライブラリ本体とヘッダファイルがそれぞれ適切な場所にインストールされます。 インストール先は通常だと /usr/local/lib および /usr/local/include に設定されますが、 configure スクリプトに適宜オプションを渡すことで変更できます。 ./configure --help とするとオプションの一覧が表示されます。

また、"qrencode" という名前のユーティリティツールが、/usr/local/bin にインストールされます。もしこのツールをインストールしたくない場合は、 configure 時に --without-tools というオプションを設定してください。

使い方

ライブラリの基本的な使い方は、ヘッダファイル (qrencode.h) に記されています。 Doxygen を使うと、ヘッダファイルからマニュアルを生成することができます。

マニュアル

使用許諾

本ライブラリの著作権は、福地健太郎にあります。また、このライブラリは GNU Lesser General Public License (LGPL) の元で公開されています。 同ライセンスに従って、貴方は自由に本ライブラリを再配布したり改変したりすることができます。 細かい規定については LGPL を参照してください。

Copyright (C) 2006-2017 Kentaro Fukuchi

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

連絡先

libqrencode の一次配布元はこのページ (https://fukuchi.org/works/qrencode/index.html) を参照してください。

バグ報告や提案・コメント・質問などは、福地健太郎までお寄せください。 ライセンスや使用条件についてのお問い合わせも左記までどうぞ。

移植や他言語へのバインディング

libqrencode のパッケージには含まれませんが、いくつかのプログラミング言語用バインディングが公開されています。

また、以下の環境にあわせた移植版が公開されています。

ACKNOWLEDGMENTS

QR コードはデンソーウェーブの登録商標です。

リード-ソロモン符号の符号化ルーチンは Phil Karn (KA9Q) の著作物です。
Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q

参考

古い版

変更履歴

Version 4.0.0 (2017.9.21)

Release Note: While the API has not been changed since the previous major release, we incremented the major version number of libqrencode to 4 because the implementation of the library has been largely changed.

This release improves the performance and memory footprints of code generation.

Now you can build libqrencode with CMake.

If you build the test programs, please note that the required SDL version has been changed from 1.2 to 2.0.

Version 3.4.4 (2014.7.24)

Release Note: When only one symbol is generated in structured-append mode, the library had inserted unnecessary chunk to the symbol and some QR Code readers fail to read it. Now the library omits the chunk and generate a symbol identical to non- structured symbol.

Version 3.4.3 (2013.8.12)

Release Note: This release contains a couple of bug fixes and a new minor feature of the command line tool. Some minor bugs in the library have been fixed.

Run Length Encoding (RLE) for SVG output decreases the size of the output file, but it makes complicated to edit the image by SVG editors. A newly introduced command line option "--rle" enables RLE. RLE will not be applied if it is not given.

Version 3.4.2 (2013.3.1)

Release Note: Micro QR Code encoder had a bug that caused incorrect output (issue #25). Now the bug has been fixed. Memory leak bug (#24) and insufficient string splitting bug have been fixed.

Version 3.4.1 (2012.10.17)

Release Note: Mutual exclusion did not work correctly since 3.3.1. If your application uses libqrencode in multithreaded environment, it is strongly recommended to update it.

Version 3.4.0 (2012.10.15)

Release Note: Three new output format, SVG, UTF8, and ANSIUTF8 have been added to the command line tool. UTF8 and ANSIUTF8 are another text art mode, using Unicode block elements for high-resolution text output. Long-awaited colored QR code has been introduced. Try "--foreground" and "--background" options to set the colors. Currently PNG and SVG supports colored output.

Version 3.3.1 (2012.4.18)

Version 3.3.0 (2012.4.1)

Release Note: Three new output format, EPS, ANSI, and ASCII text, have been added to the command line tool. ANSI and ASCII mode ignore "-size" option. Give "-t ASCIIi" to get an ASCII-mode symbol in inverted color.

QRcode_APIVersion() is requested by Matthew Baker for better support of Python ctypes binding. Check them out at https://code.google.com/p/libqrencode-ctypes/

Version 3.2.1 (2012.4.1)

Version 3.2.0 (2011.11.26)

Release Note: Binary data including '\0' is now supported. To encode a binary data, give "-8" option to qrencode, and let qrencode obtain data via standard input like "qrencode -8 -o output.png < binary". "--dpi" and "-d" are also added to embed DPI information to PNG file.

A bug in the mask pattern evaluation routine has been fixed. In some cases, libqrencode may generate a different symbol from the one that was generated by the prior libqrencode because of this bug fix, but the embedded data are not affected. The symbols generated by the old libqrencode are valid.

Experimental support of Micro QR Code encoder has been added. Some functions (QRcode_*MQR()) have been added to the library. The command line tool generates Micro QR Code when "--micro" or "-M" is given.

Version 3.1.1 (2010.2.3)

Release Note: Libqrecode had generated incorrect QR Code in some cases. Symbols larger than version 5 (error correction level Q and H) were affected. In many cases this bug did not cause serious damage thanks to the error correction mechanism, but we highly recommend you to encode symbols again using this release.

Version 3.1.0 (2009.6.6)

Release Note: This release focuses on the code cleanup and performance improve. Encoding time has been improved, drastically in large symbols. Basically this update only changes its internal code. The API is not changed, no need to recompile user applications that includes only qrencode.h. If your application refers the internal data representation (not recommended), see ChangeLog for further information.

Version 3.0.3 (2008.6.1)

Release Note: This release improves the portability of our command line tool "qrencode". The library is not changed so that any applications using libqrencode are not affected.

From this release, qrencode accepts "long" options, such as "--help". See the manpage for the detailed instructions.

Qrencode now uses getoptlong() instead of getoptlongonly() which is not available in some operating systems. If the getoptlong() is not provided or the implementation of it is not compatible with GNU's one, please try qrencode-3.0.3-gnulib, that contains the source code of the getopt_long(). Gnulib version is a test release. If you feel happy with it, please let us know and the future releases will include gnulib.

Version 3.0.2 (2008.5.18)

Version 3.0.1 (2008.5.9)

Version 3.0.0 (2008.4.30)

Release Note: Now libqrencode supports "structured-append" of symbols. A large data set can be split into multiple QR code symbols. The basic usage of structured-append is not so different from the single symbol encoding: just call QRcodeencodeStringStructured() or QRcodeencodeString8bitStructured() and they return a list of symbols. Instead of giving a string, you can encode an explicitly typed data. See the manual generated by Doxygen for the detailed usage.

Many thanks to Yusuke Mihara, who contributed a patch to add support of structured-append to version 1.0.2.

API changes:

Version 2.0.0 (2008.1.24)

Release Note: Previously libqrencode encodes lower-case alphabet characters in Alphabet- Numeric mode (upper-case alphabet and numeric) by default. According to the specification of QR code, however, it is clearly claimed that Alphabet-Numeric mode provides only upper-case alphabet (+ numeric and some symbol) characters. Since this version, libqrencode distinguishes lower-case and upper-case of alphabet characters by default. Because of that, "-c" option of qrencode is now deprecated, and "-i" option has been added. By giving "-i", qrencode converts lower-case characters to upper-case if possible, then encode a QR code symbol. Please read qrencode.h for the details about API changes if you are going to use this library.

Many thanks to NANKI Haruo for his suggestions.

Version 1.0.2 (2007.03.24)

Version 1.0.1 (2006.12.27)

Version 1.0.0 (2006.12.12)