qrcode reader canvas
HTML
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/grid.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/version.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/detector.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/formatinf.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/errorlevel.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/bitmat.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/datablock.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/bmparser.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/datamask.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/rsdecoder.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/gf256poly.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/gf256.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/decoder.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/QRCode.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/findpat.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/alignpat.js"></script>
<script src="https://raw.github.com/LazarSoft/jsqrcode/master/src/databr.js"></script>
<input type="file" accept="image/*" id="imageFile" />
<div id="result">...loading...</div>
<div id="console">w/h7</div>
<canvas id="qr-canvas"></canvas>
<img id="reader" />
CSS
#reader {
width: 100%;
height: 100%;
}
CoffeeScript
$ ->
ctx = $("#qr-canvas").get(0).getContext "2d"
$("#imageFile").on "change", ->
reader = new FileReader()
reader.onload = ->
$("#reader").on "load", ->
$("#console").text "onload"
width = $(this).width()
height = $(this).height()
$("#qr-canvas").attr(width:width,height:height).width(width).height(height)
ctx = $("#qr-canvas").get(0).getContext "2d"
ctx.drawImage(this,0,0,width,height)
qrcode.decode()
$("#reader").attr "src",reader.result
qrcode.callback = (data)->
$("#result").text data
file = $("#imageFile").get(0).files[0]
reader.readAsDataURL file