|
3 | 3 | Minimal 0-dep QR code generator & reader. |
4 | 4 |
|
5 | 5 | - 🔒 Auditable, 0-dependency |
6 | | -- 🏞️ Encoding (generating) supports ASCII, term, gif and svg codes |
| 6 | +- 🏞️ Encoding (generating) supports ASCII, term, gif, svg and png codes |
7 | 7 | - 📷 Decoding (reading) supports camera feed input, files and non-browser environments |
8 | 8 | - 🔍 Extensive tests ensure correctness: 100MB+ of vectors |
9 | 9 | - 🪶 14KB (gzipped) for encoding + decoding, 7KB for encoding |
@@ -52,6 +52,8 @@ const terminalFriendly = encodeQR(txt, 'term'); // 2x larger, all fonts are OK |
52 | 52 | const gifBytes = encodeQR(txt, 'gif'); // Uncompressed GIF |
53 | 53 | const svgElement = encodeQR(txt, 'svg'); // SVG vector image element |
54 | 54 | const array = encodeQR(txt, 'raw'); // 2d array for canvas or other libs |
| 55 | +// import { svgToPng } from 'qr/dom.js'; |
| 56 | +// const png = svgToPng(svgElement, 512, 512); // .png, using DOM |
55 | 57 |
|
56 | 58 | // Options |
57 | 59 | // Custom error correction level |
@@ -135,10 +137,6 @@ function decodeWithExternal() { |
135 | 137 | const decoded = decodeQR(parseGIF(gifBytes)); |
136 | 138 | console.log('decoded(gif)', decoded); |
137 | 139 | } |
138 | | - |
139 | | -// c) draw gif/svg to browser DOM canvas |
140 | | -import { svgToPng } from 'qr/dom.js'; |
141 | | -const png = svgToPng(encodeQR('Hello world', 'svg'), 512, 512); |
142 | 140 | ``` |
143 | 141 |
|
144 | 142 | ### Decoding options |
|
0 commit comments