简体   繁体   English

getImageData导致“未捕获错误:NOT_SUPPORTED_ERR:DOM异常9”

[英]getImageData causes “Uncaught Error: NOT_SUPPORTED_ERR: DOM Exception 9”

I'm trying to get a feel for some image manipulation in HTML5. 我试图在HTML5中感受一些图像处理。 I am finding that when I try and use the getImageData method I get this JS exception thrown. 我发现当我尝试使用getImageData方法时,我会抛出这个JS异常。 I am using Chrome and running on localhost. 我正在使用Chrome并在localhost上运行。

Thanks! 谢谢!

Okay figured out what the problem was. 好的,弄明白问题是什么。 All I have to say is "derp". 我要说的只是“derp”。 I was using 我在用

getImageData(x, x) 

but the way I was intending to use this requires 4 arguments 但我打算使用它的方式需要4个参数

getImageData(x,x,x,x)

It could be an issue with editing files on your local system using Chrome. 使用Chrome在本地系统上编辑文件可能会出现问题。 You can close Chrome and reopen it using flags --allow-file-access-from-files to allow local file editing. 您可以关闭Chrome并使用标记--allow-file-access-from-files重新打开它以允许本地文件编辑。

Came across this post when I ran into a similar issue and it helped. 当我遇到类似的问题并且它有所帮助时遇到了这篇文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM