Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] There are some read requests waitng on finished stream #298

Open
d-ivashchuk opened this issue Feb 12, 2023 · 1 comment
Open

[Error] There are some read requests waitng on finished stream #298

d-ivashchuk opened this issue Feb 12, 2023 · 1 comment

Comments

@d-ivashchuk
Copy link

hey @lukeapage! thanks for writing the library! we are currently using it in github.com/lost-pixel and I've stumbled on this annoying error which I can't make sense of. Maybe you will be able to help us here:

Code:

const express = require("express");
const { PNG } = require("pngjs");
const fs = require("fs");

const app = express();

app.get("/", (req, res) => {
  const blah = Buffer.from("blah");
  const pngBuffer = fs.readFileSync("./test.png");
  const pngBufferEdited = fs.readFileSync("./test-2.png");
  const blueBuffer = fs.readFileSync("./blue.png");
  const aotBuffer = fs.readFileSync("./aot.png");

  const png = PNG.sync.read(pngBuffer);
});

app.listen(8080);

note that all other images that I used for this reproduction work, except the test.png

Reproduction: https://codesandbox.io/s/node-js-forked-2oellg?file=/src/index.js

Image that it breaks for(test.png) in code above:

diff-8c00e7c1681ca3382f67178e05a39aab260d169db1cecd96ee3c71141fca5783

Thanks a lot for you assistance 🙌

@lukeapage
Copy link
Collaborator

I found this site: https://www.nayuki.io/page/png-file-chunk-inspector

Its corrupted/missing a chunk:

image

the library isn't great at error recovery. Feel free to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants