title: decode QR code from data URI
body: <p>I try to decode a qr-code from a data uri:</p>
  
  <pre><code>var dataUri = 'data:image/gif;base64,R0lGODdh9gD2AIAAAAAAAP///ywAAAAA9gD2AAAC...';
  decodeQrCode(dataUri, cb);
  </code></pre>
  
  <p>I already tried <a href="https://github.com/colkito/qrcode-decoder-js" rel="nofollow">qrcode-decoder-js</a> (<a href="https://jsbin.com/tebobosedi/1/edit?html,js,console,output" rel="nofollow">example with mocha test</a>)</p>
  
  <pre><code>function decodeQrCode(dataUri, cb) {
    qrcode.callback = cb;
    qrcode.decode(dataUri);
  }
  // error decoding QR Code
  </code></pre>
  
  <p>and <a href="https://github.com/cirocosta/qcode-decoder" rel="nofollow">qcode-decoder</a> (<a href="https://jsbin.com/nuvunonawi/1/edit?html,js,console,output" rel="nofollow">example with mocha test</a>)</p>
  
  <pre><code>function decodeQrCode(dataUri, cb) {
    var qr = new QCodeDecoder();
    var img = document.createElement('img');
    img.setAttribute('src', dataUri);
    qr.decodeFromImage(img, cb);
  }
  // Error decoding QR Code from Image
  </code></pre>
  
  <p>but it seems to me that both do not support data URIs inherently.</p>
  
  <p>How can I decode a QR code from a data URI? </p>