I want to load an image into <canvas>
on my laptop so that I can use getImageData()
. I'm using javascript in a local .html file. This is not a live, web-oriented project, just a personal project.
When I try to do this, I get the error: Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at Image.loadedImage.
What is the easiest way to solve this problem? I think I may have installed an Apache server in the past to solve this problem! I just tried hfs but it didn't solve the problem.
Please note that this cannot be solved by img.crossOrigin = "Anonymous"
or running on Firefox, as other outdated answers to related questions suggest.
P粉6829875772023-09-19 00:14:46
Currently, I found that installing and running Rebex solves this problem (the files must be transferred to wwwroot
)