Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I saw a QR code reading a book, but I don't have a smart phone to check it.

So I just took a picture of it and saved my PC. And I downloaded libdecoderqr0, libdecodeqr-dev, libdecodeqr-examples for reading it. But I don't know how to use it.

What do I do next, or is there a nicer way to read QR codes?

share|improve this question
up vote 18 down vote accepted


Install libdecodeqr-examples Install libdecodeqr-examples from the repositories,

Use the program, libdecodeqr-simpletest provided by the package to read your QR encoded image


running this command to read one of the test samples in the examples img folder

libdecodeqr-simpletest /usr/share/doc/libdecodeqr-examples/img/

Gives the decoded output in the console.

libdecodeqr version 0.9.3 ($Rev: 42 $)


as can be seen a url was encoded in the file

There is also a sample application that works with your webcam called libdecodeqr-webcam you need a webcam to use this, I have not tested it.

IF you would like to generate QR code you can install qrencode from the repositories.

cat input.txt | qrencode -s 10 -o test.png

The above will encode the information in the input.txt file in an image file called test.png.

or you can input text from the console with;

qrencode -s 10 -o ubuntu.png

The above will generate a QR encoded image called ubuntu.png with the url encoded in it.


Install libdmtx-utils Install libdmtx-utils from the repository and try using the tools it provides.

Libdmtx is a library for reading and writing Data Matrix 2D barcodes, two-dimensional symbols that hold a dense pattern of data with built-in error correction.

dmtxwrite - create Data Matrix barcodes, simple example;

dmtxwrite  -o image.png input.txt

This will encode text contained in input.txt in current directory to an image, image.png in current directory.

dmtxread - scan Data Matrix barcodes, simple example;

dmtxread image.png

Reads the encoded image.png and writes the decoded messages to standard output.

share|improve this answer
What a nice answer. It didn't work about the picture I took. But it works about images I generated with qrencode. It's enough. Thanks! – Benjamin Jan 24 '11 at 12:05
If you do not mind doing it online here are two good places to get your image decoded. – Sabacon Jan 24 '11 at 22:20
It works! I've saved the pages to my favorites. Thank you! – Benjamin Jan 24 '11 at 23:41
libdecodeqr-simpletest is only a checker and works only with generated qrcode. So that won't work with a photo. – ofaurax Oct 17 '13 at 9:30
data matrix seems way better, since it has a proper decoder and it can encode null bytes. this doesn't work: echo -en "\x00" | qrencode -t PNG -o lol.png – Janus Troelsen Feb 18 '14 at 11:34


A graphical interface for creating and reading QR codes.


QtQR can read QR codes from image files or from a webcam. It is able to recognise a number of specific types of QR code including web links, email addresses/messages, SMS messages and telephone numbers.

You could potentially scan the QR code from the book using a webcam. If you do this, ensure there is enough light and that you are holding the QR code flat and still. You will see a window with the webcam input on the screen. Wait until green dots appear then close the window and QtQR will tell you what was contained in the QR code.

You can install by adding the PPA ppa:qr-tools-developers/qr-tools-stable and installing the package qtqr.

share|improve this answer
Sorry, I've made the comment in the wrong browser tab. :( -- If you are going to test QtQR:, there are stable and diary PPA's, you can add the daily without too much worry. Please note that if you are running Ubuntu 10.10 you need to add an extra PPA because of some dependencies not been available (zbar) There are instructions in the launchpad site. Any feddback is greatly appreciated. Cheers! – Ramiro Algozino Sep 16 '11 at 18:09
This works in 12.04 Thank you very much! – Geppettvs D'Constanzo Dec 12 '12 at 2:18

ZBar recognizes several kinds of bar codes, including QR codes. If I install zbar-tools

$ sudo apt-get install zbar-tools

and save that QtQR image to a file called askubuntu.png, then the zbarimg utility finds and decodes the QR code

$ zbarimg askubuntu.png 
scanned 1 barcode symbols from 1 images in 0.02 seconds

There is also a zbarcam utility, which you can use to decode QR codes spotted by your web cam.

share|improve this answer

Google Chrome has an extension in the Chrome Web Store called QRreader.

If a QR code exists on a webpage, just right-click on it and voilà!

share|improve this answer

There's a Brainstorm request for a QR reader here: Included in the comments are links to Tbarcode and Decodecamera which you might want to check out. I'd link directly to them, but I can't post more than one link yet.

share|improve this answer
I've just tried DecodeCamera. But it doesn't work. The python script meet an error. – Benjamin Jan 23 '11 at 11:13
If you post the error you might be able to get help with it. The way I deal with QR codes is to just point my phone at my screen and use the app on my phone. – Tanath Jan 24 '11 at 5:32

QTQR is not possible to install onto Ubuntu 10.04 LTS - there are broken packages. Instead of this you can use this link to get it installed.

Qreator is another QR-code creator:

repository -

homepage -

Qreator installation

Open a terminal with Ctrl+Alt+T and type these commands:

 sudo add-apt-repository ppa:qreator-hackers/qreator-stable

 sudo apt-get update

 sudo apt-get install qreator
share|improve this answer

I actually wanted to be able to read these QR codes myself, so I made a little app that sits up on the system tray, you click it and it highlights all of the QR codes (or bar codes) visible on the screen and tells you what they say... Also, you can click on it and copy any of the code text to the clipboard to paste into a browser etc. I'm using ZBar, and you can check it out here...

Anyone wanna help me turn it into a package?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.