quadqr-js 1.5.3 → 1.5.6

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 CHANGED
@@ -258,7 +258,7 @@ Compression modes are `none`, `auto`, `smart`, `brotli`, `deflate`, and `lz`. `a
258
258
 
259
259
  Signing can also be composed with Secure Payload. QuadQR compresses if requested, signs the normal payload with the private key, then encrypts the protected bytes with AES-256-GCM. A verifier supplies the trusted public key separately, or resolves it from `keyId`.
260
260
 
261
- The renderer supports an explicit `mode: "print"`. Print mode enforces a minimum 4-module quiet zone, uses darker print-safe RGB defaults, and prefers Classic solid modules. `getPrintGuidance()` converts a chosen physical size into module millimeters/pixels so print layouts can be checked before production testing.
261
+ The renderer supports an explicit `mode: "print"`. Print mode uses darker print-safe RGB defaults and prefers Classic solid modules, while `quietZone` behaves exactly as it does in screen mode. Four modules remains the recommended default. `getPrintGuidance()` converts a chosen physical size into module millimeters/pixels so print layouts can be checked before production testing.
262
262
 
263
263
  Centered logos support `size: "auto"`, which estimates a conservative ECC-aware ratio from code utilization and rendering choices. `findMaxSafeLogoSize()` can additionally probe ImageData output and empirically search for the largest size that still decodes.
264
264
 
@@ -782,7 +782,7 @@ console.log(result.text);
782
782
  The `quadqr-js` package can be loaded directly from npm-backed CDNs:
783
783
 
784
784
  ```html
785
- <script src="https://cdn.jsdelivr.net/npm/quadqr-js@1.5.1/dist/quadqr.min.js"></script>
785
+ <script src="https://cdn.jsdelivr.net/npm/quadqr-js@1.5.5/dist/quadqr.min.js"></script>
786
786
  <script>
787
787
  const code = QuadQR.encodeText("Hello from a script tag");
788
788
  </script>
@@ -1104,7 +1104,7 @@ Scans one frame from an HTML video element. By default, if the video is displaye
1104
1104
 
1105
1105
  ### `startCameraScanner(video, options?)`
1106
1106
 
1107
- Starts a reusable live-camera scanning loop. On supported browsers it requests continuous focus/exposure/white-balance camera modes and scans the CSS-visible preview crop. Modern browsers use a **dual-worker camera engine**: a lightweight fresh-frame worker continuously runs normal finder/geometry/decode attempts, while an independent recovery worker retains the complete high-resolution, Auto Color, precise-alignment, perspective, multi-frame, ECC, and damaged-code recovery stack. A slow recovery attempt therefore cannot prevent the fast worker from inspecting a newer camera frame. Finder detection remains JavaScript; optional WASM accelerates grayscale/binary preprocessing and CRC beneath the same detector. The scheduler uses `requestVideoFrameCallback()` when available and does not queue stale fast-path frames. Normal camera acquisition requests an environment camera around 1280×720 and crops/resizes the visible preview to a 640 px working bitmap **before** transferring it to the worker. Once a candidate validates structure, Spectrum ECC, and CRC, scanning returns immediately. If the fast worker misses, full recovery runs concurrently on a fresh frame at up to 960 px. Strong finder evidence dispatches recovery quickly. Finder-less frames remain on the lightweight fresh-frame detector only, so pointing the camera at an empty scene never starts Auto Color or deeper recovery work. QuadQR Auto Color crop profiles, center-weighted histograms, threshold bracketing, precise alignment, projective recovery, QR-region enhancement, multi-frame confidence fusion, and soft-decision Spectrum ECC are unchanged. `cameraHighResolutionMaxDimension` defaults to 960. The optional `onDiagnostic(event)` callback exposes whether an event came from the fast or recovery worker, finder candidates, active locator method, crop/geometry/version hypothesis, recovery method, timing, and scan dimensions. `onResult(result, frame)` receives the exact frame that decoded, including enhanced recovery pixels when applicable, so UIs can keep the frozen frame and finder overlay aligned.
1107
+ Starts a reusable live-camera scanning loop. On supported browsers it requests continuous focus/exposure/white-balance camera modes and scans the CSS-visible preview crop. Modern browsers use a **dual-worker camera engine**: a lightweight fresh-frame worker continuously runs normal finder/geometry/decode attempts, while an independent recovery worker retains the complete high-resolution, Auto Color, precise-alignment, perspective, multi-frame, ECC, and damaged-code recovery stack. A slow recovery attempt therefore cannot prevent the fast worker from inspecting a newer camera frame. Finder detection remains JavaScript; optional WASM accelerates grayscale/binary preprocessing and CRC beneath the same detector. The scheduler uses `requestVideoFrameCallback()` when available and does not queue stale fast-path frames. Normal camera acquisition requests an environment camera around 1280×720 and crops/resizes the visible preview to a 640 px working bitmap **before** transferring it to the worker. Once a candidate validates structure, Spectrum ECC, and CRC, scanning returns immediately. If the fast worker misses, full recovery runs concurrently on a fresh frame at up to 960 px. Strong finder evidence dispatches recovery quickly. Finder-less frames remain on the lightweight fresh-frame detector only, so pointing the camera at an empty scene never starts Auto Color or deeper recovery work. QuadQR Auto Color crop profiles, center-weighted histograms, threshold bracketing, precise alignment, projective recovery, QR-region enhancement, multi-frame confidence fusion, and soft-decision Spectrum ECC are unchanged. `cameraHighResolutionMaxDimension` defaults to 960. The optional `onDiagnostic(event)` callback exposes whether an event came from the fast or recovery worker, finder candidates, active locator method, crop/geometry/version hypothesis, recovery method, timing, and scan dimensions. `onResult(result, frame)` receives the exact frame that decoded, including enhanced recovery pixels when applicable, so UIs can keep the frozen frame and finder overlay aligned. For repeated scanning, `continuous: true` is the preferred shorthand for keeping the stream alive (`stopOnResult: false` remains supported). Continuous mode suppresses the same CRC result for `duplicateCooldown` milliseconds by default (1200 ms), invalidates late results from the other worker lane after a successful decode, and resets tracking before the next symbol. `pauseWhenHidden` defaults to `true`; hidden tabs stop scheduling scan work and resume with fresh state. The returned scanner also exposes `pause()` and `resume()`, accepts an `AbortSignal` through `signal`, and cleans up if the camera track ends unexpectedly. The main-thread fallback now uses the same candidate-gated recovery rule, so miss count alone never wakes Auto Color or deeper recovery.
1108
1108
 
1109
1109
  ### `getVersionInfo(version, options?)`
1110
1110
 
@@ -1281,4 +1281,4 @@ AGPL v3.0. See `LICENSE`.
1281
1281
 
1282
1282
  **Experimental / research project**
1283
1283
 
1284
- QuadQR is actively evolving. Format details may change between versions until the wire format is considered stable.
1284
+ QuadQR is actively evolving. Format details may change between versions until the wire format is considered stable.
package/SPECIFICATION.md CHANGED
@@ -253,9 +253,9 @@ inset
253
253
 
254
254
  ### Print mode
255
255
 
256
- `mode: "print"` applies conservative defaults:
256
+ `mode: "print"` applies print-oriented defaults:
257
257
 
258
- - minimum quiet zone of 4 modules unless explicitly overridden;
258
+ - caller-controlled quiet-zone sizing, identical to screen mode (4 modules recommended by default);
259
259
  - print-safe darker RGB primaries;
260
260
  - Classic solid-module rendering by default;
261
261
  - physical-size guidance through `getPrintGuidance()`.