agilgur5 / react-signature-canvas

A React wrapper component around signature_pad (in < 150 LoC). Unopinionated and heavily updated fork of react-signature-pad
https://agilgur5.github.io/react-signature-canvas/
Other
527 stars 115 forks source link

Warning in browser console: `Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true` when calling `toDataURL` #105

Open nmalancea opened 2 months ago

nmalancea commented 2 months ago

Screenshot 2024-04-29 at 1 01 41 PM

I get this warning in the browser console when calling toDataURL:

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true

Any ideas how to correctly configure the canvas to set { willReadFrequently: true }?

agilgur5 commented 2 months ago

We might need to add a prop for the canvas's contextAttributes

Beatriz2529 commented 3 weeks ago

Hello, I have the same problem. Could you give me an exemple please ?

agilgur5 commented 3 weeks ago

I don't believe there's a workaround for this as the CanvasContext manipulation is not user-facing. That's why I wrote that this may require new props to support (it is an open feature request, there are no existing examples).

In any case, this is a warning from a more recent browser feature and can safely be ignored.