Generate canvas image using local computer
P粉547362845
P粉547362845 2023-09-18 08:44:24
0
1
507

I want to load an image intoon my laptop so that I can usegetImageData(). 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.

P粉547362845
P粉547362845

reply all (1)
P粉682987577

Currently, I found that installing and runningRebexsolves this problem (the files must be transferred towwwroot)

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!