qrcode

Welcome to the QRCode Processing library page!

First, let me apologize for the rather poor documentation. At some point, this will be remedied. For now, here is some basic information:

Download the Processing QRCode library
Download the Processing QRCode library example
(Special thanks to Tom Igoe for the original code that I started with.)

This library is really nothing other than a bridge to using the Open Source QR Code library with Processing. From the QR Code web site: “QR Code is a two-dimensional barcode, used widely in Japan. The advantage of QR Code from well-known barcode is larger data capacity (more than 100 bytes, typically) and error correction.”

QRCode images can be generated at http://qrcode.kaywa.com/.

Here is a basic summary of how to use the library:

Download and install the library, and import it like so:

import pqrcode.*;

Create and initialize a decoder object:

Decoder decoder;

void setup() {
  decoder = new Decoder(this);
}

You can ask the Decoder object to decode any image:

PImage img = loadImage("qrcode.jpg");
decoder.decodeImage(img);

It runs in a separate thread and whenever it is finished, an event is triggered via the decoderEvent() method:

void decoderEvent(Decoder decoder) {
  String statusMsg = decoder.getDecodedString();
  println(statusMsg);
}

Ok, have fun everyone!!


25 Responses to “Processing QRCode Library”  

  1. 1 lenny

    i love processing too ! (;
    it works !
    great stuff. thanks or the effort man.

  2. 2 Jeroen

    Hi

    When trying to use your example given above, I get the following error:

    java.lang.UnsupportedClassVersionError: pqrcode/Decoder (Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    Can you explain me what is going wrong here?

    Thanks

  3. 3 Manuel

    same problem as jeroen. what can I do?

  4. 4 Daniel

    I’ve updated the library to fix this issue, try downloading it again and let me know!

  5. 5 Manuel

    i downloaded the library and tryed an older java version, too.
    but i get the same error. thanks for your trouble

  6. 6 Manuel

    I’ve downloaded processing without java, now it works!

  7. 7 Manuel

    I’ve downloaded processing without java, now it works!

  8. 8 Jo

    I’m getting the (Unsupported major.minor version 49.0) error as well.

  9. 9 corne

    i’m getting the following error, tried with multiple camera’s but still getting the error:

    quicktime.std.StdQTException[QTJava:7.3.0g],-9405=couldntGetRequiredComponent,QT.vers:7308000
    at quicktime.std.StdQTException.checkError(StdQTException.java:38)

    does anybody know what to do with this one?

  10. 10 hemc

    how can i import this sample into Netbeans?

    he always says “cannot find symbol”

    can you give me a hint?

    thx

    cyaz
    Hemc

  11. 11 da5id.b

    Hi Dan,

    The library is great. Now i’m trying it out with my own qrcodes.
    Still have to set it, but i noticed an error that comes out frequently with the pqrcode_example you provided in this page:

    java.lang.ArrayIndexOutOfBoundsException: 100
    at jp.sourceforge.qrcode.codec.reader.QRCodeDataBlockReader.getNextBits(QRCodeDataBlockReader.java:65)

    Does somebody have an idea about the source of this error?

    Thanks!

  12. 12 hey dan

    Is it possible to inbed the app into a website? i have it working really well with a few changes so it opens new web pages from a qr code! (which is really cool)! but iam having problems inbedding it and linking it to the app.

    what do I need to do??

    Any help would be much appreciated! :)

  13. 13 Sean Owen

    The “UnsupportedVersionError” comes from the fact that it was compiled by a later version of Java than you guys are using, and was not specifically targeted for an earlier version.

    That source code should be compilable back to Java 1.2 or maybe before. Daniel I think you just need “-target 1.2″ on your javac command.

    Or, folks with the issue, use a newer verison of Java. I think major version 49 = Java 5, which is not even that new. Go to Java 6 if you can.

  14. 14 Sean Owen

    da5id.b that’s an error from the qrcode library. I think it is a little buggy.

    May I plug our open-source decoder, ZXing: http://code.google.com/p/zxing

    I’d happily rewrite the wrapper here to use this decoder. I’d bet dollars to donuts its faster and more accurate.

  15. 15 abnoba12

    Is it posible to have it decode many QR Codes in a single image. The project I’m working on requires it. Nice app BTW.

  16. 16 Daniel

    Hey Sean, thanks for the info about ZXing, I’m definitely going to investigate, might be worth making a Processing specific library for ZXing which I’d be happy to do!

  17. 17 Ramon

    Hi!
    I am 22 years old and I’m in 2 year of Electronic Art and Digital Design in a university from Barcelona, Spain.
    I’m trying to program a very simple code by myself in Processing similar to the AudioPad or the Reactable using QRCode. I don’t have lots of experience in programing, but I try hard with new things. How could I know the position of various qrcodes in the sketch? In your library is there any function that returns you the position of the qrcode? And if it’s not very complicated, the same with the rotation.
    I would be very pleased if you could say me something about this, if you know any other library, any book…. or any other thing that could help me with this.

    Thanks for all! ^^

  18. 18 Alex

    If found a good website on QR code. You can generate barcodes, decode them with mobiles, etc. : http://www.jaxo-systems.com

  19. 19 David

    Do you have any netbeans example of use this library ?

  20. 20 Daniel

    David: Sorry, I don’t, but the source code is there for adaptation

  21. 21 lee

    hi , plz spend some time to direct me to install this library.
    i’m intrested in using this library . i used this library as a package in my prog. but showing errors
    can u spend some time so that i can use this library..
    thankz in advance…

  22. 22 lee

    PImage img = loadImage(“qrcode.jpg”);

    when i used this,
    here “PImage” shows error…
    is it because of some missing classes???

  23. 23 lorocue
  1. 1 Letter Never Sent by Chris Sivori » QR-Code: Linking the physical world
  2. 2 imatrix / QR Codes on the iPhone | steve cooley presents


Leave a Reply