zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.

Home Page:https://zxing-js.github.io/library/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple readback operations using getImageData

yudielcurbelo opened this issue · comments

Warning:

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

It should come from this line of code.

const ctx = elem.getContext('2d');

and should be resolved with the following change.

 const ctx = elem.getContext('2d', {willReadFrequently: true});

Warning can be reproduced in this example https://zxing-js.github.io/library/examples/multi-camera/

Hi @odahcam and @werthdavid can you push a new version with this fix please

Will do!

plz try 0.19.3

Confirmed, working as expected on 0.19.3. Thank you @werthdavid

May I ask you to test 0.20.0 as well? I merged lots of PRs there, currently testing it myself as well

All my tests passed on 0.20.0, and doing some manual tests is also working as intended.