qr-camera-scanner 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/MIGRATING.md +135 -0
- package/README.md +83 -2
- package/THIRD_PARTY_LICENSES +231 -0
- package/llms.txt +389 -0
- package/package.json +78 -4
- package/src/camera.js +170 -0
- package/src/darkness.js +47 -0
- package/src/decode-worker.js +191 -0
- package/src/decoder-client.js +269 -0
- package/src/defaults.js +99 -0
- package/src/errors.js +42 -0
- package/src/frame-grabber.js +75 -0
- package/src/index.d.ts +258 -0
- package/src/index.js +17 -0
- package/src/region.js +100 -0
- package/src/repeat.js +95 -0
- package/src/scanner.js +829 -0
- package/src/stats.js +66 -0
- package/src/zxing_reader.wasm +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1 (2026-11-28)
|
|
4
|
+
|
|
5
|
+
- Published straight from GitHub: npm now shows that each version was built
|
|
6
|
+
from this repository's code. No changes to how the scanner works.
|
|
7
|
+
|
|
8
|
+
## 0.1.0 (2026-11-28)
|
|
9
|
+
|
|
10
|
+
First release.
|
|
11
|
+
|
|
12
|
+
- Scan QR codes and other barcodes with the camera, without making the page slow or jumpy.
|
|
13
|
+
- Read only the codes inside a box you draw over the camera picture.
|
|
14
|
+
- Switch cameras, use the flashlight and zoom, where the phone supports them.
|
|
15
|
+
- Report a code once while it is held up, instead of on every frame.
|
|
16
|
+
- Tell when it is too dark to read.
|
|
17
|
+
- Explain camera problems in your own words.
|
|
18
|
+
- Turn the camera off when the page is hidden, and back on when it is shown.
|
|
19
|
+
- Optional statistics, to find out why scanning is slow on a phone.
|
|
20
|
+
- A demo page, a guide for switching from other scanners, and a guide for AI assistants.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 daviddawe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/MIGRATING.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Switching to qr-camera-scanner
|
|
2
|
+
|
|
3
|
+
Coming from another browser QR scanner? This page maps the calls you know to
|
|
4
|
+
this package. Most switches take a few minutes.
|
|
5
|
+
|
|
6
|
+
Two things work differently from most scanners:
|
|
7
|
+
|
|
8
|
+
- **You keep your own `<video>` element** and draw your own box over it. The
|
|
9
|
+
package has no built-in interface, so it fits any design.
|
|
10
|
+
- **The heavy work runs in the background** (a Web Worker), which keeps the
|
|
11
|
+
page smooth on phones where other scanners stutter.
|
|
12
|
+
|
|
13
|
+
Not included: scanning still images or uploaded files. For that, use the
|
|
14
|
+
[barcode-detector](https://github.com/Sec-ant/barcode-detector) package
|
|
15
|
+
directly (this package is built on it).
|
|
16
|
+
|
|
17
|
+
**One thing to watch:** what your scan callback returns matters here.
|
|
18
|
+
Returning `false` means "not now, offer this code again later". Write the
|
|
19
|
+
callback with braces, `(result) => { use(result.data); }`, so a helper that
|
|
20
|
+
happens to return `false` does not decline codes by accident.
|
|
21
|
+
|
|
22
|
+
## From qr-scanner (nimiq)
|
|
23
|
+
|
|
24
|
+
`qr-scanner` 1.4.2 (last release November 2022) has a similar shape, so most
|
|
25
|
+
code carries over almost line by line.
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
// Before
|
|
29
|
+
import QrScanner from 'qr-scanner';
|
|
30
|
+
const scanner = new QrScanner(video, (result) => use(result.data), {
|
|
31
|
+
returnDetailedScanResult: true,
|
|
32
|
+
preferredCamera: 'environment',
|
|
33
|
+
maxScansPerSecond: 10,
|
|
34
|
+
});
|
|
35
|
+
await scanner.start();
|
|
36
|
+
|
|
37
|
+
// After
|
|
38
|
+
import QrCameraScanner from 'qr-camera-scanner';
|
|
39
|
+
const scanner = new QrCameraScanner(video, (result) => { use(result.data); }, {
|
|
40
|
+
camera: 'environment',
|
|
41
|
+
maxScansPerSecond: 10,
|
|
42
|
+
});
|
|
43
|
+
await scanner.start();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
| qr-scanner | qr-camera-scanner |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `new QrScanner(video, onDecode, options)` | `new QrCameraScanner(video, onDecode, options)` |
|
|
49
|
+
| `returnDetailedScanResult: true` | not needed: results always have `data`, `format`, `cornerPoints` |
|
|
50
|
+
| `preferredCamera` | `camera` |
|
|
51
|
+
| `maxScansPerSecond` | `maxScansPerSecond` |
|
|
52
|
+
| `calculateScanRegion` | `region`: an element drawn over the video, or a function returning `{ x, y, width, height }` |
|
|
53
|
+
| `highlightScanRegion`, `highlightCodeOutline`, `overlay` | not built in: draw your own box and pass it as `region`; `result.cornerPoints` gives the code outline |
|
|
54
|
+
| `onDecodeError` | `onError` (only real errors; "no code in this frame" is not reported) |
|
|
55
|
+
| `start()` / `stop()` / `destroy()` | `start()` / `stop()` / `destroy()` |
|
|
56
|
+
| `pause()` | `pause()` (the camera stays on) and `resume()` |
|
|
57
|
+
| `setCamera(facingModeOrDeviceId)` | `setCamera(...)` (reopens the previous camera if the new one fails) |
|
|
58
|
+
| `QrScanner.listCameras(true)` | `QrCameraScanner.listCameras()`, called after `start()` |
|
|
59
|
+
| `QrScanner.hasCamera()` | `(await QrCameraScanner.listCameras()).length > 0` |
|
|
60
|
+
| `hasFlash()`, `isFlashOn()` | `hasTorch()`, `isTorchOn()` |
|
|
61
|
+
| `toggleFlash()`, `turnFlashOn()`, `turnFlashOff()` | `toggleTorch()`, `setTorch(true)`, `setTorch(false)` |
|
|
62
|
+
| `setInversionMode('both')` | no setting: the ZXing reader always tries light-on-dark codes; built-in browser readers usually do too |
|
|
63
|
+
| `QrScanner.scanImage(file)` | not included (see above) |
|
|
64
|
+
| `QrScanner.WORKER_PATH` | not needed: the worker is bundled by your build tool |
|
|
65
|
+
| your own `visibilitychange` handler calling `stop()` / `start()` | remove it: the camera is turned off while the page is hidden and back on when shown (`releaseWhenHidden`) |
|
|
66
|
+
|
|
67
|
+
Also new: `repeatQuietMs` (report a code held up only once), `setZoom()`,
|
|
68
|
+
`formats` (other barcode types), `onDarkChange` (too dark to read) and
|
|
69
|
+
`cameraErrorKind()` (turn camera errors into a message).
|
|
70
|
+
|
|
71
|
+
## From html5-qrcode
|
|
72
|
+
|
|
73
|
+
`html5-qrcode` creates its own video inside a container element. Here you add
|
|
74
|
+
the `<video>` yourself, plus a box for the scan area if you want one.
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<!-- Before -->
|
|
78
|
+
<div id="reader"></div>
|
|
79
|
+
|
|
80
|
+
<!-- After -->
|
|
81
|
+
<div style="position: relative; width: 360px; height: 480px">
|
|
82
|
+
<video id="camera" style="width: 100%; height: 100%; object-fit: cover"></video>
|
|
83
|
+
<div id="frame" style="position: absolute; inset: 25%; border: 3px solid white"></div>
|
|
84
|
+
</div>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
// Before
|
|
89
|
+
import { Html5Qrcode } from 'html5-qrcode';
|
|
90
|
+
const reader = new Html5Qrcode('reader');
|
|
91
|
+
await reader.start(
|
|
92
|
+
{ facingMode: 'environment' },
|
|
93
|
+
{ fps: 10, qrbox: { width: 250, height: 250 } },
|
|
94
|
+
(decodedText) => use(decodedText),
|
|
95
|
+
);
|
|
96
|
+
// later
|
|
97
|
+
await reader.stop();
|
|
98
|
+
reader.clear();
|
|
99
|
+
|
|
100
|
+
// After
|
|
101
|
+
import QrCameraScanner from 'qr-camera-scanner';
|
|
102
|
+
const scanner = new QrCameraScanner(
|
|
103
|
+
document.getElementById('camera'),
|
|
104
|
+
(result) => { use(result.data); },
|
|
105
|
+
{ camera: 'environment', maxScansPerSecond: 10, region: document.getElementById('frame') },
|
|
106
|
+
);
|
|
107
|
+
await scanner.start();
|
|
108
|
+
// later
|
|
109
|
+
scanner.destroy();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
| html5-qrcode | qr-camera-scanner |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `new Html5Qrcode(elementId)` | `new QrCameraScanner(videoElement, onDecode, options)` |
|
|
115
|
+
| `start(cameraConfig, config, onSuccess, onError)` | options in the constructor, then `start()` |
|
|
116
|
+
| `{ facingMode: 'environment' }` or a camera id | `camera: 'environment'`, `'user'` or a device id |
|
|
117
|
+
| `config.fps` | `maxScansPerSecond` |
|
|
118
|
+
| `config.qrbox` | `region`: the element you draw over the video |
|
|
119
|
+
| `config.aspectRatio` | `videoConstraints: { aspectRatio: 1.333 }` (or `width` and `height`) |
|
|
120
|
+
| `applyVideoConstraints()` | `videoConstraints` option; torch and zoom have their own methods |
|
|
121
|
+
| `formatsToSupport: [Html5QrcodeSupportedFormats.QR_CODE, ...]` | `formats: ['qr_code', 'ean_13', ...]` |
|
|
122
|
+
| `onSuccess(decodedText, decodedResult)` | `onDecode(result)` with `result.data` and `result.format` |
|
|
123
|
+
| `onError` (called for every frame without a code) | `onError` (only real errors) |
|
|
124
|
+
| `stop()` + `clear()` | `destroy()` (or `stop()` to start again later) |
|
|
125
|
+
| `pause()` / `resume()` | `pause()` / `resume()` |
|
|
126
|
+
| `Html5Qrcode.getCameras()`, then `start(cameraId, ...)` | `start()` first (back camera), then `QrCameraScanner.listCameras()` and `setCamera(id)`: camera names are only known after the camera was allowed. Example in [`llms.txt`](llms.txt) ("Pick a camera by name"). |
|
|
127
|
+
| torch through `applyVideoConstraints` | `hasTorch()`, `setTorch(on)` |
|
|
128
|
+
| `Html5QrcodeScanner` (ready-made interface) | not included: build the few buttons you need with the methods above |
|
|
129
|
+
| `scanFile()` | not included (see above) |
|
|
130
|
+
|
|
131
|
+
## After switching
|
|
132
|
+
|
|
133
|
+
- Call `destroy()` when the page or component goes away, or the camera stays on.
|
|
134
|
+
- Add `repeatQuietMs: 3000` if the same code should not fire repeatedly.
|
|
135
|
+
- Full reference, framework examples and troubleshooting: [`llms.txt`](llms.txt).
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# qr-camera-scanner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scan QR codes (and other barcodes) with the camera in a web page, without
|
|
4
|
+
making the page slow or jumpy.
|
|
5
|
+
|
|
6
|
+
Some scanners make the page stutter on some phones, because the heavy work
|
|
7
|
+
runs in the same place as the page itself. This one does the heavy work in
|
|
8
|
+
the background, so the camera picture and the buttons stay smooth.
|
|
9
|
+
|
|
10
|
+
**Try it:** https://daviddawe.github.io/qr-camera-scanner/ (on a phone, or a computer with a webcam;
|
|
11
|
+
your browser will ask to use the camera).
|
|
12
|
+
|
|
13
|
+
Running the demo from a copy of this project: `npm install`, then `npm run demo`, and open the
|
|
14
|
+
address it prints. Opening `demo/index.html` straight from the disk does not work.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install qr-camera-scanner
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
It needs a build tool such as Vite, webpack or Parcel, and the page must be
|
|
23
|
+
served over HTTPS (or from `localhost`), or the browser won't allow the camera.
|
|
24
|
+
To try it on a phone, put the page online at a secure (https) address: a
|
|
25
|
+
phone cannot open your computer's `localhost`.
|
|
26
|
+
|
|
27
|
+
## Use
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<div style="position: relative; width: 360px; height: 480px">
|
|
31
|
+
<video id="camera" style="width: 100%; height: 100%; object-fit: cover"></video>
|
|
32
|
+
<!-- the box drawn over the camera picture -->
|
|
33
|
+
<div id="frame" style="position: absolute; inset: 25%; border: 3px solid white"></div>
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
import QrCameraScanner from 'qr-camera-scanner';
|
|
39
|
+
|
|
40
|
+
const scanner = new QrCameraScanner(
|
|
41
|
+
document.getElementById('camera'),
|
|
42
|
+
(result) => { console.log('Scanned:', result.data); },
|
|
43
|
+
{ region: document.getElementById('frame'), repeatQuietMs: 3000 },
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
await scanner.start();
|
|
47
|
+
|
|
48
|
+
// when you are done
|
|
49
|
+
scanner.destroy();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
It keeps scanning after each code. `region` makes it read only the codes
|
|
53
|
+
inside your box. `repeatQuietMs` stops the same code from being reported again
|
|
54
|
+
and again while it is held up.
|
|
55
|
+
|
|
56
|
+
## What else it can do
|
|
57
|
+
|
|
58
|
+
- Switch cameras: `scanner.setCamera('user')` (front) or `'environment'` (back)
|
|
59
|
+
- Flash: `scanner.setTorch(true)`, if the phone has one
|
|
60
|
+
- Zoom: `scanner.setZoom(2)`, if the camera supports it
|
|
61
|
+
- Other barcodes: `formats: ['qr_code', 'ean_13', 'code_128']`
|
|
62
|
+
- Tell when it is too dark: `onDarkChange: (dark) => { ... }`
|
|
63
|
+
- Explain camera problems in your own words: `cameraErrorKind(error)` gives
|
|
64
|
+
`'permission'`, `'no-camera'`, `'in-use'` and so on
|
|
65
|
+
|
|
66
|
+
Every option and method, with examples, is in [`llms.txt`](llms.txt). It is
|
|
67
|
+
written so an AI assistant can help you set the scanner up, and people can
|
|
68
|
+
read it too.
|
|
69
|
+
|
|
70
|
+
Switching from `qr-scanner` or `html5-qrcode`? See [`MIGRATING.md`](MIGRATING.md).
|
|
71
|
+
|
|
72
|
+
## Works in
|
|
73
|
+
|
|
74
|
+
Made for recent Chrome, Edge, Safari (iPhone and Mac) and Firefox. Tested so
|
|
75
|
+
far in Chrome on Android and on a computer; the others are not tested yet.
|
|
76
|
+
|
|
77
|
+
## Contributing
|
|
78
|
+
|
|
79
|
+
Read [`AGENTS.md`](AGENTS.md) first (it is for people and AI coding agents).
|
|
80
|
+
Security problems: see [`SECURITY.md`](SECURITY.md).
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT. Includes the open-source ZXing barcode reader; see `THIRD_PARTY_LICENSES`.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Third-party software shipped in this package
|
|
2
|
+
============================================
|
|
3
|
+
|
|
4
|
+
src/zxing_reader.wasm is the ZXing reader WebAssembly build from the
|
|
5
|
+
zxing-wasm package (https://github.com/Sec-ant/zxing-wasm), copied unchanged:
|
|
6
|
+
zxing-wasm 3.1.8 (as pinned by barcode-detector 3.2.5), built from ZXing-C++
|
|
7
|
+
commit f66b8ab4909e2ce33a1dc68add372e8d2ef99007, SHA-256
|
|
8
|
+
8451d7fe72f3d8e9ced56c7b6805e8bab88a0c218bfcd25c47c0a999e8188f3d (checked by
|
|
9
|
+
scripts/copy-wasm.mjs on every pack). It contains:
|
|
10
|
+
|
|
11
|
+
- ZXing-C++ (https://github.com/zxing-cpp/zxing-cpp)
|
|
12
|
+
Licensed under the Apache License, Version 2.0 (text below).
|
|
13
|
+
|
|
14
|
+
- zxing-wasm's C++ bindings (src/cpp/ZXingWasm.cpp in zxing-wasm)
|
|
15
|
+
Licensed under the Apache License, Version 2.0 (text below).
|
|
16
|
+
|
|
17
|
+
- zxing-wasm specific code, Copyright (c) 2023 Ze-Zheng Wu
|
|
18
|
+
Licensed under the MIT License (text below).
|
|
19
|
+
|
|
20
|
+
The JavaScript decoder wrapper (barcode-detector, MIT) and zxing-wasm's
|
|
21
|
+
JavaScript are installed as npm dependencies under their own licenses, not
|
|
22
|
+
copied into this package.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
------------------------------------------------------------------------------
|
|
26
|
+
Apache License, Version 2.0
|
|
27
|
+
------------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
Apache License
|
|
30
|
+
Version 2.0, January 2004
|
|
31
|
+
http://www.apache.org/licenses/
|
|
32
|
+
|
|
33
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
34
|
+
|
|
35
|
+
1. Definitions.
|
|
36
|
+
|
|
37
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
38
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
39
|
+
|
|
40
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
41
|
+
the copyright owner that is granting the License.
|
|
42
|
+
|
|
43
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
44
|
+
other entities that control, are controlled by, or are under common
|
|
45
|
+
control with that entity. For the purposes of this definition,
|
|
46
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
47
|
+
direction or management of such entity, whether by contract or
|
|
48
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
49
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
50
|
+
|
|
51
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
52
|
+
exercising permissions granted by this License.
|
|
53
|
+
|
|
54
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
55
|
+
including but not limited to software source code, documentation
|
|
56
|
+
source, and configuration files.
|
|
57
|
+
|
|
58
|
+
"Object" form shall mean any form resulting from mechanical
|
|
59
|
+
transformation or translation of a Source form, including but
|
|
60
|
+
not limited to compiled object code, generated documentation,
|
|
61
|
+
and conversions to other media types.
|
|
62
|
+
|
|
63
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
64
|
+
Object form, made available under the License, as indicated by a
|
|
65
|
+
copyright notice that is included in or attached to the work
|
|
66
|
+
(an example is provided in the Appendix below).
|
|
67
|
+
|
|
68
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
69
|
+
form, that is based on (or derived from) the Work and for which the
|
|
70
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
71
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
72
|
+
of this License, Derivative Works shall not include works that remain
|
|
73
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
74
|
+
the Work and Derivative Works thereof.
|
|
75
|
+
|
|
76
|
+
"Contribution" shall mean any work of authorship, including
|
|
77
|
+
the original version of the Work and any modifications or additions
|
|
78
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
79
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
80
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
81
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
82
|
+
means any form of electronic, verbal, or written communication sent
|
|
83
|
+
to the Licensor or its representatives, including but not limited to
|
|
84
|
+
communication on electronic mailing lists, source code control systems,
|
|
85
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
86
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
87
|
+
excluding communication that is conspicuously marked or otherwise
|
|
88
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
89
|
+
|
|
90
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
91
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
92
|
+
subsequently incorporated within the Work.
|
|
93
|
+
|
|
94
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
95
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
96
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
97
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
98
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
99
|
+
Work and such Derivative Works in Source or Object form.
|
|
100
|
+
|
|
101
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
102
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
103
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
104
|
+
(except as stated in this section) patent license to make, have made,
|
|
105
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
106
|
+
where such license applies only to those patent claims licensable
|
|
107
|
+
by such Contributor that are necessarily infringed by their
|
|
108
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
109
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
110
|
+
institute patent litigation against any entity (including a
|
|
111
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
112
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
113
|
+
or contributory patent infringement, then any patent licenses
|
|
114
|
+
granted to You under this License for that Work shall terminate
|
|
115
|
+
as of the date such litigation is filed.
|
|
116
|
+
|
|
117
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
118
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
119
|
+
modifications, and in Source or Object form, provided that You
|
|
120
|
+
meet the following conditions:
|
|
121
|
+
|
|
122
|
+
(a) You must give any other recipients of the Work or
|
|
123
|
+
Derivative Works a copy of this License; and
|
|
124
|
+
|
|
125
|
+
(b) You must cause any modified files to carry prominent notices
|
|
126
|
+
stating that You changed the files; and
|
|
127
|
+
|
|
128
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
129
|
+
that You distribute, all copyright, patent, trademark, and
|
|
130
|
+
attribution notices from the Source form of the Work,
|
|
131
|
+
excluding those notices that do not pertain to any part of
|
|
132
|
+
the Derivative Works; and
|
|
133
|
+
|
|
134
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
135
|
+
distribution, then any Derivative Works that You distribute must
|
|
136
|
+
include a readable copy of the attribution notices contained
|
|
137
|
+
within such NOTICE file, excluding those notices that do not
|
|
138
|
+
pertain to any part of the Derivative Works, in at least one
|
|
139
|
+
of the following places: within a NOTICE text file distributed
|
|
140
|
+
as part of the Derivative Works; within the Source form or
|
|
141
|
+
documentation, if provided along with the Derivative Works; or,
|
|
142
|
+
within a display generated by the Derivative Works, if and
|
|
143
|
+
wherever such third-party notices normally appear. The contents
|
|
144
|
+
of the NOTICE file are for informational purposes only and
|
|
145
|
+
do not modify the License. You may add Your own attribution
|
|
146
|
+
notices within Derivative Works that You distribute, alongside
|
|
147
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
148
|
+
that such additional attribution notices cannot be construed
|
|
149
|
+
as modifying the License.
|
|
150
|
+
|
|
151
|
+
You may add Your own copyright statement to Your modifications and
|
|
152
|
+
may provide additional or different license terms and conditions
|
|
153
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
154
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
155
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
156
|
+
the conditions stated in this License.
|
|
157
|
+
|
|
158
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
159
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
160
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
161
|
+
this License, without any additional terms or conditions.
|
|
162
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
163
|
+
the terms of any separate license agreement you may have executed
|
|
164
|
+
with Licensor regarding such Contributions.
|
|
165
|
+
|
|
166
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
167
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
168
|
+
except as required for reasonable and customary use in describing the
|
|
169
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
170
|
+
|
|
171
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
172
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
173
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
174
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
175
|
+
implied, including, without limitation, any warranties or conditions
|
|
176
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
177
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
178
|
+
appropriateness of using or redistributing the Work and assume any
|
|
179
|
+
risks associated with Your exercise of permissions under this License.
|
|
180
|
+
|
|
181
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
182
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
183
|
+
unless required by applicable law (such as deliberate and grossly
|
|
184
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
185
|
+
liable to You for damages, including any direct, indirect, special,
|
|
186
|
+
incidental, or consequential damages of any character arising as a
|
|
187
|
+
result of this License or out of the use or inability to use the
|
|
188
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
189
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
190
|
+
other commercial damages or losses), even if such Contributor
|
|
191
|
+
has been advised of the possibility of such damages.
|
|
192
|
+
|
|
193
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
194
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
195
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
196
|
+
or other liability obligations and/or rights consistent with this
|
|
197
|
+
License. However, in accepting such obligations, You may act only
|
|
198
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
199
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
200
|
+
defend, and hold each Contributor harmless for any liability
|
|
201
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
202
|
+
of your accepting any such warranty or additional liability.
|
|
203
|
+
|
|
204
|
+
END OF TERMS AND CONDITIONS
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
------------------------------------------------------------------------------
|
|
208
|
+
MIT License (zxing-wasm)
|
|
209
|
+
------------------------------------------------------------------------------
|
|
210
|
+
|
|
211
|
+
MIT License
|
|
212
|
+
|
|
213
|
+
Copyright (c) 2023 Ze-Zheng Wu
|
|
214
|
+
|
|
215
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
216
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
217
|
+
in the Software without restriction, including without limitation the rights
|
|
218
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
219
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
220
|
+
furnished to do so, subject to the following conditions:
|
|
221
|
+
|
|
222
|
+
The above copyright notice and this permission notice shall be included in all
|
|
223
|
+
copies or substantial portions of the Software.
|
|
224
|
+
|
|
225
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
226
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
227
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
228
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
229
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
230
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
231
|
+
SOFTWARE.
|