@ericblade/quagga2 1.6.0 → 1.7.2
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/README.md +22 -4
- package/cypress.config.ts +14 -0
- package/dist/quagga.js +600 -873
- package/dist/quagga.min.js +3 -2
- package/lib/quagga.js +737 -1010
- package/package.json +35 -31
- package/tsconfig.json +5 -0
- package/type-definitions/quagga.d.ts +14 -11
- package/CHANGELOG.md +0 -213
package/README.md
CHANGED
|
@@ -23,7 +23,15 @@ node functionality.
|
|
|
23
23
|
|
|
24
24
|
## Using React / Redux?
|
|
25
25
|
|
|
26
|
-
Please see also https://github.com/ericblade/quagga2-react-example
|
|
26
|
+
Please see also <https://github.com/ericblade/quagga2-react-example/> and <https://github.com/ericblade/quagga2-redux-middleware/>
|
|
27
|
+
|
|
28
|
+
## Using Angular?
|
|
29
|
+
|
|
30
|
+
Please see <https://github.com/julienboulay/ngx-barcode-scanner> or <https://github.com/classycodeoss/mobile-scanning-demo>
|
|
31
|
+
|
|
32
|
+
## Using ThingWorx?
|
|
33
|
+
|
|
34
|
+
Please see <https://github.com/ptc-iot-sharing/ThingworxBarcodeScannerWidget>
|
|
27
35
|
|
|
28
36
|
## What is QuaggaJS?
|
|
29
37
|
|
|
@@ -54,6 +62,7 @@ be aligned with the viewport.
|
|
|
54
62
|
|
|
55
63
|
Quagga makes use of many modern Web-APIs which are not implemented by all
|
|
56
64
|
browsers yet. There are two modes in which Quagga operates:
|
|
65
|
+
|
|
57
66
|
1. analyzing static images and
|
|
58
67
|
2. using a camera to decode the images from a live-stream.
|
|
59
68
|
|
|
@@ -66,6 +75,7 @@ of the used Web-APIs for each mode:
|
|
|
66
75
|
### Static Images
|
|
67
76
|
|
|
68
77
|
The following APIs need to be implemented in your browser:
|
|
78
|
+
|
|
69
79
|
- [webworkers](http://caniuse.com/#feat=webworkers)
|
|
70
80
|
- [canvas](http://caniuse.com/#feat=canvas)
|
|
71
81
|
- [typedarrays](http://caniuse.com/#feat=typedarrays)
|
|
@@ -75,6 +85,7 @@ The following APIs need to be implemented in your browser:
|
|
|
75
85
|
### Live Stream
|
|
76
86
|
|
|
77
87
|
In addition to the APIs mentioned above:
|
|
88
|
+
|
|
78
89
|
- [MediaDevices](http://caniuse.com/#feat=stream)
|
|
79
90
|
|
|
80
91
|
__Important:__ Accessing `getUserMedia` requires a secure origin in most
|
|
@@ -149,14 +160,19 @@ You can also build the library yourself and copy `quagga.js` file from the `dist
|
|
|
149
160
|
You can include the following script tags with CDN links:
|
|
150
161
|
|
|
151
162
|
a) `quagga.js`
|
|
163
|
+
|
|
152
164
|
```html
|
|
153
165
|
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2/dist/quagga.js"></script>
|
|
154
166
|
```
|
|
167
|
+
|
|
155
168
|
b) `quagga.min.js` (minified version)
|
|
169
|
+
|
|
156
170
|
```html
|
|
157
171
|
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2/dist/quagga.min.js"></script>
|
|
158
172
|
```
|
|
173
|
+
|
|
159
174
|
*Note: You can include a specific version of the library by including the version as shown below.*
|
|
175
|
+
|
|
160
176
|
```html
|
|
161
177
|
<!-- Link for Version 1.2.6 -->
|
|
162
178
|
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.2.6/dist/quagga.js"></script>
|
|
@@ -222,10 +238,13 @@ quagga, then you can run from the quagga directory:
|
|
|
222
238
|
```
|
|
223
239
|
npm install && npm run build && npm link
|
|
224
240
|
```
|
|
241
|
+
|
|
225
242
|
then from the other project directory that needs this quagga, do
|
|
243
|
+
|
|
226
244
|
```
|
|
227
245
|
npm link @ericblade/quagga2
|
|
228
246
|
```
|
|
247
|
+
|
|
229
248
|
When linking is successful, all future runs of 'npm run build' will update the version that is
|
|
230
249
|
linked in the project. When combined with an application using webpack-dev-server or some other
|
|
231
250
|
hot-reload system, you can do very rapid iteration this way.
|
|
@@ -588,7 +607,6 @@ values which worked best during development.
|
|
|
588
607
|
Only two properties are relevant for the use in Quagga (`halfSample` and
|
|
589
608
|
`patchSize`) whereas the rest is only needed for development and debugging.
|
|
590
609
|
|
|
591
|
-
|
|
592
610
|
```javascript
|
|
593
611
|
{
|
|
594
612
|
halfSample: true,
|
|
@@ -630,7 +648,7 @@ recommended to crank up the resolution in order to find a barcode.
|
|
|
630
648
|
## Examples
|
|
631
649
|
|
|
632
650
|
The following example takes an image `src` as input and prints the result on the
|
|
633
|
-
console. The decoder is configured to detect
|
|
651
|
+
console. The decoder is configured to detect *Code128* barcodes and enables the
|
|
634
652
|
locating-mechanism for more robust results.
|
|
635
653
|
|
|
636
654
|
```javascript
|
|
@@ -760,7 +778,7 @@ If you add a new test file, you should also make sure to import it in either cyp
|
|
|
760
778
|
## Image Debugging
|
|
761
779
|
|
|
762
780
|
In case you want to take a deeper dive into the inner workings of Quagga, get to
|
|
763
|
-
know the
|
|
781
|
+
know the *debugging* capabilities of the current implementation. The various
|
|
764
782
|
flags exposed through the `config` object give you the ability to visualize
|
|
765
783
|
almost every step in the processing. Because of the introduction of the
|
|
766
784
|
web-workers, and their restriction not to have access to the DOM, the
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from 'cypress'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
video: false,
|
|
5
|
+
screenshotOnRunFailure: false,
|
|
6
|
+
trashAssetsBeforeRuns: true,
|
|
7
|
+
e2e: {
|
|
8
|
+
// We've imported your old cypress plugins here.
|
|
9
|
+
// You may want to clean this up later by importing these.
|
|
10
|
+
setupNodeEvents(on, config) {
|
|
11
|
+
return require('./cypress/plugins/index.js')(on, config)
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
})
|