24

Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image.

raven
  • 18,004
  • 16
  • 81
  • 112
fmsf
  • 36,317
  • 49
  • 147
  • 195

3 Answers3

65

Using brew, it is easy to install zbar, a QR code reader.

brew install zbar

Then a QR code can be read by calling:

zbarimg qrcode_file.png

Also @jm666, brew can be used to install opencv.

The Matt
  • 1,423
  • 1
  • 12
  • 22
9

Unfortunately, the most used library libdecodeqr is depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by Image::DecodeQR perl module - but unsuccessful).

Fortunately, found this link: http://macscripter.net/viewtopic.php?id=37404 from citing the next:

  1. Download the ZBar source code.
  2. Unpack the the tarball, and open the resulting directory in a Terminal window.
  3. Type ./configure --disable-video --without-python --without-gtk --without-qt to configure the build process, limiting dependencies to ImageMagick.
  4. Type "make" to invoke the build process.
  5. Type "sudo make install", and enter an administrator password when prompted.

You will need ImageMagick what can be installed from macports.

After installing the ZBar, you can nicely decode qrcode with a command

zbarimg qrcode_file.png

Tested on OS X Mavericks 10.9.2 (and Lion/10.7.5)- and works nicely. Becasue it only depends on ImageMagick (exists in macports)- should be easily "compilable" on other OS X versions too.

clt60
  • 62,119
  • 17
  • 107
  • 194
5

There is an open-source command line tool named ZBar. It takes a photo as an argument and extracts the information out of any QRCode that it detects in the image.

The open-source project QR-Reader-Mac provides an Applescript script that acts as a wrapper to zbar. You can create a shortcut to the script for processing QRCodes or create a service, as explained below. The script will automatically open the URL contained within the QRCode in your default browser.

Usage

qrreader

Step by step

ZBar can be easily installed with Homebrew:

brew install zbar

To install QR-Reader-Mac:

  1. Open the QR-Reader-Mac GitHub project page, select Code, and download the project as a ZIP file:

    enter image description here

  2. Double click the ZIP file to extract it.

  3. Double click the workflow you want to install. The following Pop-UP should appear:

  4. Confirm by pressing install.

  5. Open System Preferences and add a shortcut to the open_QRCode service under Keyboard > Shortcuts > Services > General: image

(Important: Note that QR-Reader-Mac expects to find the executable 'zbarimg' in /usr/local/bin/zbarimg, which is the standard path Homebrew will install it.)

Copy to Clipboard

The QRCode2Clipboard.workflow can be used to extract the content of the QR-Codes into the Clipboard. It can be installed in the same way as the open_QRCode.workflow.