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>
<script src="https://raw.github.com/stomita/ios-imagefile-megapixel/master/src/megapix-image.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" />
<button id="decode">decode</button>
CSS
#reader {
width: 50%;
height: 50%;
}
CoffeeScript
$ ->
ctx = $("#qr-canvas").get(0).getContext "2d"
qrcode.callback = (data)->
$("#result").text data
$("#imageFile").on "change", ->
mpImg = new MegaPixImage this.files[0]
mpImg.render($("#qr-canvas").get(0), maxWidth: 300, maxHeight: 300, orientation:6 )
$("#decode").on "click", ->
qrcode.callback = (data)->
$("#result").text data
qrcode.decode()