QrenCode : 命令行下生成二维码图片

26
2011
# 作者: riku / 本文采用CC BY-NC-SA 2.5协议授权,转载请注明本文链接

对于二维码大家应该并不陌生,英文名为 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=2000

http://wowubuntu.com

Hit any key to end.

作者:riku

Bio: 关注新网络、Web2.0、移动应用;Nexus S/Andorid,iPad,FreeBSD,Ubuntu 用户;伪设计师,好推墙运动。
链接:Blog - Twitter - Facebook - 此作者的更多文章

28 Responses to QrenCode : 命令行下生成二维码图片

Avatar

liukai

Internet Explorer 6.0 Internet Explorer 6.0 Windows XP Windows XP

三月 26th, 2011 at 6:17 下午

二维码现在用处大不?

[Reply]

Avatar

liukai

Internet Explorer 6.0 Internet Explorer 6.0 Windows XP Windows XP

三月 26th, 2011 at 6:18 下午

丢人,我的是Ubuntu+Chrome10

[Reply]

Google Chrome 12.0.712.0 Google Chrome 12.0.712.0 GNU/Linux GNU/Linux

riku Reply:

@liukai, 呃??? 不是吧。

[Reply]

Firefox 4.0b13pre Firefox 4.0b13pre GNU/Linux GNU/Linux

JessonChan Reply:

@liukai, [偷笑]

[Reply]

Chromium 10.0.648.151 Chromium 10.0.648.151 Ubuntu 10.04 Ubuntu 10.04

飘零迷丁儿 Reply:

@liukai, 介个...暴露了...博客系统崩溃了

[Reply]

Firefox 4.0b13pre Firefox 4.0b13pre GNU/Linux GNU/Linux

JessonChan Reply:

@飘零迷丁儿,
为什么你的显示是Ubuntu而我是GNU/Linux,介个很个性呀

[Reply]

Google Chrome 10.0.648.204 Google Chrome 10.0.648.204 GNU/Linux GNU/Linux

freetstar Reply:

@liukai, 有时候这个插件是会抽筋的。。

[Reply]

Chromium 15.0.874.106 Chromium 15.0.874.106 Ubuntu 11.10 Ubuntu 11.10

shily Reply:

@freetstar,

无聊的测试下现在好用不。

Ubuntu 11.10 Chrome 15

[Reply]

Avatar

JessonChan

Firefox 4.0b13pre Firefox 4.0b13pre GNU/Linux GNU/Linux

三月 26th, 2011 at 6:22 下午

果断安装,谢谢介绍~……

[Reply]

Avatar

linushuo

Google Chrome 10.0.648.204 Google Chrome 10.0.648.204 GNU/Linux x64 GNU/Linux x64

三月 26th, 2011 at 7:51 下午

可以识别二维码吗?ubuntu上貌似没有找到软件可以识别二维码

[Reply]

Google Chrome 12.0.712.0 Google Chrome 12.0.712.0 GNU/Linux GNU/Linux

riku Reply:

@linushuo, 有了,看我 update 部分。

[Reply]

Avatar

liukai

Internet Explorer 6.0 Internet Explorer 6.0 Windows XP Windows XP

三月 26th, 2011 at 7:53 下午

看看FF4能识别不...

[Reply]

Google Chrome 12.0.712.0 Google Chrome 12.0.712.0 Windows 7 Windows 7

ballkids Reply:

@liukai, 依然 IE6

[Reply]

Avatar

布布

Firefox 3.6.16 Firefox 3.6.16 Ubuntu 10.10 Ubuntu 10.10

三月 26th, 2011 at 10:43 下午

不错,收下了。正好用上

[Reply]

Avatar

luc

Opera Mini 5.0.019802 Opera Mini 5.0.019802 iPhone iPhone

三月 27th, 2011 at 4:07 上午

Debian 下有木有?

[Reply]

Avatar

Luc

Safari 5.0.2 Safari 5.0.2 iPhone iOS 4.3.1 iPhone iOS 4.3.1

三月 27th, 2011 at 4:19 上午

Debian的仓库里也有。

[Reply]

Avatar

ruziyjie

Android Webkit Android Webkit Android 2.1 Android 2.1

三月 27th, 2011 at 6:33 上午

en

[Reply]

Avatar

yixf

Firefox 3.6.16 Firefox 3.6.16 Ubuntu 10.10 x64 Ubuntu 10.10 x64

三月 27th, 2011 at 8:41 上午

qrencode可以编码;那在Ubuntu中什么软件可以解码?

[Reply]

Google Chrome 12.0.712.0 Google Chrome 12.0.712.0 GNU/Linux GNU/Linux

riku Reply:

@yixf, 见 update 部分。

[Reply]

Avatar

ruziyjie

Internet Explorer 6.0 Internet Explorer 6.0 Windows Server 2003 Windows Server 2003

三月 27th, 2011 at 12:37 下午

看看.......

[Reply]

Chromium 10.0.648.151 Chromium 10.0.648.151 Ubuntu 10.04 Ubuntu 10.04

飘零迷丁儿 Reply:

@ruziyjie, 我了个去...果断是故意的...求指教求鞭策...

[Reply]

Firefox 4.0 Firefox 4.0 Windows 7 Windows 7

ruziyjie Reply:

@飘零迷丁儿, 呵呵,怀念经典啊。

[Reply]

Avatar

wuiwu

Android Webkit 4.0 Android Webkit 4.0 Android 2.2.1 Android 2.2.1

三月 27th, 2011 at 1:56 下午

不错啊'android如果能用就好了

[Reply]

Avatar

doro

Opera 11.10 Opera 11.10 Linux Mint Linux Mint

三月 28th, 2011 at 12:57 上午

本来打算将ed2k链接生成二维码,却识别不了

[Reply]

Avatar

QrenCode:命令行下生成二维码图片 : OSMSG

WordPress 3.1 WordPress 3.1

三月 28th, 2011 at 11:37 上午

[...] 消息来自:wowubuntu [...]

Avatar

doro

Opera 11.10 Opera 11.10 GNU/Linux GNU/Linux

三月 29th, 2011 at 2:12 上午

不错嘛

[Reply]

Avatar

Mike Ma

Firefox 3.6.16 Firefox 3.6.16 Fedora 14 x64 Fedora 14 x64

四月 20th, 2011 at 9:20 下午

貌似不错……求GTK+版

[Reply]

Avatar

erasin

Google Chrome 11.0.696.68 Google Chrome 11.0.696.68 GNU/Linux GNU/Linux

五月 31st, 2011 at 3:13 下午

国内二维码越来越时兴起来了,特别是手机应用

[Reply]

Comment Form

top

无觅相关文章插件,快速提升流量