3

I'm trying to decode a QR code which is in a jpeg image, that I post to AppEngine, in the Java version.

I have tried to use ZXing, but couldn't manage to. The obvious solution would be to use their 'Javase' module, but that needs to use BufferedImage and ImageIO, which are not available in AppEngine.

Is there some alternate solution?

Vespas
  • 385
  • 1
  • 3
  • 11

2 Answers2

0

You could use the zxing online decoder:

QR code example:

http://thierry-leriche-dessirier.developpez.com/tutoriels/java/creer-qrcode-zxing-java2d-5-min/images/qrcode_dvp.png

php script example:

file_get_contents('http://zxing.org/w/decode?u=thierry-leriche-dessirier.developpez.com/tutoriels/java/creer-qrcode-zxing-java2d-5-min/images/qrcode_dvp.png');

A very good tutorial (in french):

RafaSashi
  • 16,483
  • 8
  • 84
  • 94
0

Try bundling the BufferedImage and ImageIO jar files into the WEB-INF/lib directory of your project or perhaps the Referenced Libraries of your project in Eclipse.

Martin Berends
  • 3,948
  • 2
  • 16
  • 19
  • Hi. Where can I find these jars you mention? – Vespas Feb 24 '14 at 19:30
  • On many websites if you bother to look. I thought from what you wrote that you had the ZXing JavaSE module working locally but not on AppEngine. I searched the Internet and found many results such as http://www.findjar.com/index.x?query=awt.image.bufferedimage and http://stackoverflow.com/questions/7502181/where-can-i-download-jai-and-jai-imageio so I am sure you can find many sources if you try. – Martin Berends Feb 24 '14 at 19:48
  • Tried using Jai, as suggested in the stackoverflow link, but no good: the AppEngine environment restricts all usage of awt, and the JPEGDecoder returns a Raster, which is a awt class. – Vespas Feb 25 '14 at 12:30
  • If all the libraries you want to use are available in source code form, import all those folders and files into your project. Your application should be able to link to them and their compiled class files will be bundled into your deployment. – Martin Berends Feb 25 '14 at 12:52