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?

  • The simplest way to scan a QR Code is to use one of those online services like e.g. qr4u.online, webqr.com – 4xy Sep 12 '17 at 10:30
up vote 28 down vote accepted

FOR QR CODE

Install the zbarimg command line application by running: sudo apt-get install zbar-tools

Use the program, zbarimg provided by the package to read your QR encoded image

EXAMPLE

from command line:

zbarimg "image-file-name.jpg"

The above will display what is encoded in the image in the terminal.

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 http://www.ubuntu.com

The above will generate a QR encoded image called ubuntu.png with the url http://www.ubuntu.com encoded in it.

WEB APPLICATIONS

you can encode and decode online at: online barcodereader.com and at: ZXing Decoder Online

FOR DATAMATRIX

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.

  • 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
  • I could not get the libdecodeqr examples to output anything. dmtx seems to be very limited regarding the size of the data; a regular SSH key wouldn't fit. (Also, libdmtx.org points to something very different nowadays.) – Raphael Mar 13 at 10:34

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 
QR-Code:http://askubuntu.com
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.

QtQR

A graphical interface for creating and reading QR codes.

QtQR

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.

  • Sorry, I've made the comment in the wrong browser tab. :( -- If you are going to test QtQR: launchpad.net/qr-tools, 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

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à!

There's a Brainstorm request for a QR reader here: http://brainstorm.ubuntu.com/item/15111/ 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.

  • 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

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...

http://cnlohr.blogspot.com/2011/08/desktop-qr-code-reader-for-ubuntu.html

Anyone wanna help me turn it into a package?

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 - https://launchpad.net/qreator

homepage - http://davidplanella.org/project-showcase/qreator/

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

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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