Question

I have some canvas code that works great in safari and chrome, but fails in firefox.

The firefox console reads:

[17:44:13.372] uncaught exception: [Exception... "Operation is not supported" code: "9" nsresult: "0x80530009 (NotSupportedError)" location: "http://REDACTED.js Line: 703"]

Firebug gives the slightly-more-useful-to-humans:

Operation is not supported
var data = ctx.getImageData(x,y,1,1);

I am indeed calling .getImageData on line 703.

I have read that similar errors have been reported with regards to origin policies. This project is hosted on a web server (not local), and I haven't loaded any images from a different domain and put them on the canvas. In fact, I get the error even if the canvas is blank.

The webkit-based browsers give me the pixel data as asked, what can be done about firefox? Thanks.

Was it helpful?

Solution

Don't pass NaN to .getImageData.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top