Skip to content

Commit 5ec7019

Browse files
committed
Pass image data directly to barcode detector.
1 parent daf8071 commit 5ec7019

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/barcodes.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ async function _detectWithHspLuminance({barcodeDetector, video}) {
4949
data[i], data[i + 1], data[i + 2]);
5050
data[i] = data[i + 1] = data[i + 2] = luminance;
5151
}
52-
ctx.putImageData(imageData, 0, 0);
5352

54-
// try to detect barcode in updated image
55-
return barcodeDetector.detect(canvas);
53+
// try to detect barcode in image data
54+
return barcodeDetector.detect(imageData);
5655
}
5756

5857
// HSP = hue, saturation, and "perceived brightness" -- a potential improvement

0 commit comments

Comments
 (0)