Skip to content

Commit 37d5620

Browse files
committed
transfer image data to worker rather than copy
1 parent 0115a4d commit 37d5620

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/browser/src/createQRScannerInternal.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@ module.exports = function () {
540540
thisScanCycle = function () {
541541
if (processing) { return }
542542
processing = true
543-
scanWorker.postMessage(getCurrentImageData(video));
543+
const imageData = getCurrentImageData(video)
544+
scanWorker.postMessage(imageData, [imageData.data.buffer]);
544545
};
545546
thisScanCycle();
546547
}, error);

0 commit comments

Comments
 (0)