Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

BnWWorker.js:4 Uncaught TypeError: Cannot read property 'data' of undefined at onmessage #69

Open
maschad96 opened this issue May 16, 2017 · 0 comments

Comments

@maschad96
Copy link

	var imagedata = event.data.imgData,
		intensity = event.data.intensity,
		px = imagedata.data, // The line throwing the error. Could you help address this?
		grey = null,
		length = px.length;

	for (var i = 0; i < length; i += 4) {
		var k = px[i] * 0.3 + px[i + 1] * 0.59 + px[i + 2] * 0.11;
		px[i] = ~~ (k * intensity + px[i] * (1 - intensity));
		px[i + 1] = ~~ (k * intensity + px[i + 1] * (1 - intensity));
		px[i + 2] = ~~ (k * intensity + px[i + 2] * (1 - intensity));
	}

	postMessage(imagedata);

};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant