Skip to content

ImageData data assignment in Strict Mode #314

@eliorar

Description

@eliorar

img.data = imgData // this line is not working in strict mode (line 527 heatmap.js);
this.ctx.putImageData(img, x, y);
this._renderBoundaries = [1000, 1000, 0, 0];
the error is as follows:
TypeError: Cannot assign to read only property 'data' of #<ImageData>

Possible solution:
according to documentation:
https://developer.mozilla.org/en-US/docs/Web/API/ImageData
you should use only putImageData function, so removing img.data = imgData resolves the issue

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