Warning in browser console: `Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true` when calling `toDataURL`
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 }?
We might need to add a prop for the canvas's contextAttributes
Hello, I have the same problem. Could you give me an exemple please ?
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.
Does this error cause any performance issue? since you haven't added the feature yet shall I ignore this error at the moment? @agilgur5
It's not an error, it's a warning, so by definition you can ignore it.
And the warning is about a newer browser feature that did not exist until years after this library was created. It worked fine without the feature and will continue to work fine without it.
Enabling it for some use-cases will allow for a performance optimization (which is what this issue is labeled as). But again, it works fine without this.
We might need to add a prop for the canvas's
contextAttributes
Looks like upstream enabled the same: https://github.com/szimek/signature_pad/pull/761#issuecomment-1986951356
Looks like upstream enabled the same: https://github.com/szimek/signature_pad/pull/761#issuecomment-1986951356
@agilgur5 refer to signature_pad that it's fixed there, but it's useless for this package react-signature-canvas. It is not updated or compatible with the given version of signature_pad.
Would you update the react-signature-canvas package to be compatible with the new version of signature_pad?
thank you very much
@agilgur5 refer to
signature_padthat it's fixed there, but it's useless for this package react-signature-canvas. It is not updated
I'm very aware of that, that's why this issue is still open, and not closed. Recording a note that upstream introduced a similar feature is worthwhile in and of itself as it will be useful for future implementation.
Would you update the react-signature-canvas package to be compatible with the new version of
signature_pad?
There is already a separate issue(s) for that, see https://github.com/agilgur5/react-signature-canvas/issues/73#issuecomment-2052280336.