mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-19 18:01:30 +00:00
fix(scanner): prefer ZXing WASM BarcodeDetector for Data Matrix reliability
This commit is contained in:
parent
463d7b89f6
commit
34dd3c707c
1 changed files with 5 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ global.$ = global.jQuery = require("jquery");
|
||||||
|
|
||||||
//Use the local WASM file for the ZXing library
|
//Use the local WASM file for the ZXing library
|
||||||
import {
|
import {
|
||||||
|
BarcodeDetector as ZXingBarcodeDetector,
|
||||||
setZXingModuleOverrides,
|
setZXingModuleOverrides,
|
||||||
} from "barcode-detector/ponyfill";
|
} from "barcode-detector/ponyfill";
|
||||||
import wasmFile from "../../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm";
|
import wasmFile from "../../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm";
|
||||||
|
|
@ -59,3 +60,7 @@ setZXingModuleOverrides({
|
||||||
return prefix + path;
|
return prefix + path;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Prefer the ZXing WASM detector over inconsistent native BarcodeDetector implementations.
|
||||||
|
// This improves Data Matrix decoding reliability for difficult DigiKey labels (see #1281).
|
||||||
|
globalThis.BarcodeDetector = ZXingBarcodeDetector;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue