Skip to content
This repository was 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

@maschad96

Description

@maschad96
	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);

};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions