对于二维码大家应该并不陌生,英文名为 2-dimensional bar code 或 QR Code,是一种用图形记载信息的技术,最常见的是应用在手机应用上。用户通过手机摄像头扫描二维码或输入二维码下面的号码、关键字即可实现快速手机上网,快速便捷地浏览网页、下载图文、音乐、视频等等。
在 Ubuntu / Linux 上,有一个名为 QrenCode 的命令行工具可以很容易帮我们生成二维码。
# 安装:
sudo apt-get install qrencode
# 使用:
qrencode -o [filename.png] ‘[text/url/information to encode]‘
比如要生成本站的二维码
qrencode -o wowubuntu.png 'http://wowubuntu.com'
输出图形如下,如果你的手机上安装了二维码识别软件的庆,你可以用手机进行拍摄并识别了。
想自定义尺寸的话,加上 -s 参数,比如 -s 6 表示尺寸为 6x6 平方像表大小,如下。
qrencode -o ~/Desktop/google.png -s 6 'http://wowubuntu.com'
除此之外,你还可以使用更多其它参数,详细用法请 man qrencode 。
- 消息来源
Update: 命令行下识别二维码:
# 安装 libdecodeqr-examples
apt-get install libdecodeqr-examples
使用
libdecodeqr-simpletest <二维码图片>
比如识别之前生成的二维码图片
libdecodeqr-simpletest wowubuntu.png
输出结果
libdecodeqr-simpletest wowubuntu.png
libdecodeqr version 0.9.3 ($Rev: 42 $)
STATUS=2000http://wowubuntu.com
Hit any key to end.
28 Responses to QrenCode : 命令行下生成二维码图片
liukai
三月 26th, 2011 at 6:17 下午
二维码现在用处大不?
[Reply]
liukai
三月 26th, 2011 at 6:18 下午
丢人,我的是Ubuntu+Chrome10
[Reply]
riku Reply:
三月 26th, 2011 at 6:22 下午
@liukai, 呃??? 不是吧。
[Reply]
JessonChan Reply:
三月 26th, 2011 at 6:23 下午
@liukai, [偷笑]
[Reply]
飘零迷丁儿 Reply:
三月 26th, 2011 at 6:28 下午
@liukai, 介个...暴露了...博客系统崩溃了
[Reply]
JessonChan Reply:
三月 26th, 2011 at 7:08 下午
@飘零迷丁儿,
为什么你的显示是Ubuntu而我是GNU/Linux,介个很个性呀
[Reply]
freetstar Reply:
三月 26th, 2011 at 7:03 下午
@liukai, 有时候这个插件是会抽筋的。。
[Reply]
shily Reply:
一月 6th, 2012 at 10:00 上午
@freetstar,
无聊的测试下现在好用不。
Ubuntu 11.10 Chrome 15
[Reply]
JessonChan
三月 26th, 2011 at 6:22 下午
果断安装,谢谢介绍~……
[Reply]
linushuo
三月 26th, 2011 at 7:51 下午
可以识别二维码吗?ubuntu上貌似没有找到软件可以识别二维码
[Reply]
riku Reply:
三月 27th, 2011 at 7:51 下午
@linushuo, 有了,看我 update 部分。
[Reply]
liukai
三月 26th, 2011 at 7:53 下午
看看FF4能识别不...
[Reply]
ballkids Reply:
三月 26th, 2011 at 11:27 下午
@liukai, 依然 IE6
[Reply]
布布
三月 26th, 2011 at 10:43 下午
不错,收下了。正好用上
[Reply]
luc
三月 27th, 2011 at 4:07 上午
Debian 下有木有?
[Reply]
Luc
三月 27th, 2011 at 4:19 上午
Debian的仓库里也有。
[Reply]
ruziyjie
三月 27th, 2011 at 6:33 上午
en
[Reply]
yixf
三月 27th, 2011 at 8:41 上午
qrencode可以编码;那在Ubuntu中什么软件可以解码?
[Reply]
riku Reply:
三月 27th, 2011 at 7:51 下午
@yixf, 见 update 部分。
[Reply]
ruziyjie
三月 27th, 2011 at 12:37 下午
看看.......
[Reply]
飘零迷丁儿 Reply:
三月 28th, 2011 at 9:05 下午
@ruziyjie, 我了个去...果断是故意的...求指教求鞭策...
[Reply]
ruziyjie Reply:
三月 29th, 2011 at 7:57 上午
@飘零迷丁儿, 呵呵,怀念经典啊。
[Reply]
wuiwu
三月 27th, 2011 at 1:56 下午
不错啊'android如果能用就好了
[Reply]
doro
三月 28th, 2011 at 12:57 上午
本来打算将ed2k链接生成二维码,却识别不了
[Reply]
QrenCode:命令行下生成二维码图片 : OSMSG
三月 28th, 2011 at 11:37 上午
[...] 消息来自:wowubuntu [...]
doro
三月 29th, 2011 at 2:12 上午
不错嘛
[Reply]
Mike Ma
四月 20th, 2011 at 9:20 下午
貌似不错……求GTK+版
[Reply]
erasin
五月 31st, 2011 at 3:13 下午
国内二维码越来越时兴起来了,特别是手机应用
[Reply]