Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript QR Code Reader - can it be done? Or, Remote Service?

I'm doing a bit of preliminary research on an upcoming project and I have a quick question that I figure I'll throw up here while I look elsewhere, in case anyone has any experience with this.

The question is simple: is it possible to read a QR code using JavaScript? Is there a remote service to which I can pass a bitmap object from a camera and do it that way? Are there currently any libraries that allow this?

The project is going to be deployed to various mobile devices and we'd like to try to use Appcelerator to make it work. I know Appcelerator does expose the Camera API on its host devices, but whatever we do with it has to be able to parse QR codes. Is this something that can be done?

Thanks in advance! myk

like image 412
Myk Avatar asked Apr 02 '10 13:04

Myk


People also ask

How do you read a QR code on a website?

1. 3D Touch the Chrome app icon and choose Scan QR Code. 2. Pull down to reveal the Spotlight search box, search for "QR" and select Scan QR Code from Chrome's listing.

How QR codes are detected?

A QR reader can identify a standard QR code based on the three large squares outside the QR code. Once it has identified these three shapes, it knows that everything contained inside the square is a QR code. The QR reader then analyzes the QR code by breaking the whole thing down to a grid.

Can QR codes be read by humans?

The point is that these symbols are not meant to be read by the unaided human eye, but instead by a computer's aided eye. If your mobile phone has a camera and the right app loaded into it, it can interpret one of these.

Can QR codes be tampered with?

The FBI is warning that cybercriminals have tampered with QR codes to steal consumers' login, financial information and money. Crooks are altering both digital and physical QR codes and replacing them with malicious code, the Jan. 19 warning said.


3 Answers

I bet it's possible, but it would be a challenge. Someone's written an AS3 library for reading QR codes. I'd start by reading up on image manipulation in Canvas.

If you go down the remote API route, Kaywa have an API you may be able to use.

like image 93
dave1010 Avatar answered Sep 27 '22 23:09

dave1010


You can use the getUserMedia API to get video from the webcam and you could put it into a canvas element and use the canvas to read the pixels and decode a QR code.

I don't know of a library to decode QR codes but here is one library that can do bar codes.

like image 39
Jab2870 Avatar answered Sep 27 '22 21:09

Jab2870


There's a javascript library already, however the comments are mostly in Japanese and there's no documentation.

like image 24
Bugster Avatar answered Sep 27 '22 21:09

Bugster