开源二维码库

文章详细介绍了在Ubuntu 10.4上安装并使用zbar库遇到的编译错误和在Qt环境下使用时的解决办法。提供了解决QRCode解析问题的最新代码下载链接,并分享了libdmtx库用于读写DataMatrix二维码的方法,以及Zxing库作为Java的二维码处理库的介绍。同时提供了在线生成和解析二维码的工具链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

zbar  (解析库) c 库.
协议: GNU LGPL 2.1
支持: EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.
平台: Linux/Unix, Windows, iPhone®, embedded...
其它: 还有针对gtk/pygtk/Qt/iPhone/widget 和 java/python/perl/ 的demo.

ubuntu 10.4 上的zbar-tools 不够新, 一般的QR Code 都解析不了. 强烈推荐最新代码

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hg clone http://zbar.hg.sourceforge.net:8000/hgroot/zbar
cd zbar
autoreconf --install
./configure

In file included from zbar/debug.h:62,
from zbar/scanner.c:35:
/usr/include/stdio.h:397: error: expected identifier or ‘(’ before ‘while’

1. 编译错误
注释 include/zbar/debug.h 第62行
#include <stdio.h> 放到最前面去


2. 使用Qt
include/zbar/Image.h 308 _cleanup() 函数, 把断言注释掉..
问题出现在QZBarThread::processImage() 中64行的
Image tmp = image.convert(*(long*)"Y800");

convert里 return Image(img); 在析构Image时出错了!



小白了!! 请使用最新release版 0.10 -> http://nchc.dl.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2
0.10 除了Utf8 外其它都是好的!!


UTF-8.
QZBarThread.cpp 50行
QString data = QString::fromUtf8(sym->get_data().c_str());



+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


libdmtx 读写Data Matrix 二维码

echo -n 'Hello, world!' | dmtxwrite -o test.png
dmtxread test.png


Zxing 一个java的库.

在线生成二维码
http://qrcode.kaywa.com/
在线解析二维码
http://zxing.org/w/decode.jspx


引自:http://hi.baidu.com/yurenjimi/blog/item/85e95fdedcbee057cdbf1a48.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值