LazarSoft / jsqrcode

Javascript QRCode scanner
http://www.webqr.com
Apache License 2.0
3.96k stars 1.16k forks source link

Client-side picture scanning and generate qr-code. #91

Open username1565 opened 5 years ago

username1565 commented 5 years ago

test.html not working on client-side from zip. So this page qr_picture_scanning.html - added. There is available to scan qr-code on client-side from picture. Supporting formats: png/gif/jpg and, maybe, etc...

  1. Load picture from URL, without need to enable allow-access-control-origin (CORS).
  2. Download this as file.
  3. Upload image from downloaded file.
  4. Get base64 without any problem with canvas.toDataURL()
  5. Capture QR-code from base64 encoded image
  6. Result is available then.

All actions are available on client-side and picture qith qr-code can be cached.


Demo: https://username1565.github.io/jsqrcode/src/qr_picture_scanning.html Styles from here: https://zxing.org/w/decode.jspx Generate qr-code on client-side you can here (See source code): https://username1565.github.io/brainwallet.github.io/ QR-code generator added in last commit.