Skip to content

Incorrect output for images around 300x300 pixels and up. #11

@sbj42

Description

@sbj42

node-pnglib seems to have some trouble producing images around 300x300 pixels and higher. The image seems to stop part-way. That is, the top part of the image looks right, but the bottom is broken in some way (may render as the background color, or may be "blank").

As the image size goes up, the area of the image that looks right stays the same, so I suspect some kind of limit of addressing or file size or something like that.

See the sample script below:

  • node v8.11.1
  • node-pnglib v1.5.5
const pnglib = require('node-pnglib');
const fs = require('fs');

const W = 300;
const H = 300;

const png = new pnglib(W, H, undefined, 'red');

for (let y = 0; y < H; y ++) {
    for (let x = 0; x < W; x ++) {
        png.setPixel(x, y, 'blue');
    }
}

fs.writeFileSync('test.png', png.getBuffer());

test

Expected output: a blue square.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions