I want to load an image intoon 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? IthinkI 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 byimg.crossOrigin = "Anonymous"
or running on Firefox, as other outdated answers to related questions suggest.
Currently, I found that installing and runningRebexsolves this problem (the files must be transferred to
wwwroot
)