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

Use in node.js #31

Open
dan-toonkids opened this issue Jan 12, 2022 · 3 comments
Open

Use in node.js #31

dan-toonkids opened this issue Jan 12, 2022 · 3 comments

Comments

@dan-toonkids
Copy link

Hi,
I'm trying to use the parseAPNG() function in node.js but keep receiving the 'Not a PNG' error.
I'm reading the .apng file to a 'Buffer', then converting it to an 'ArrayBuffer' before sending to parseAPNG().
Am I doing something wrong?
Thanks !

@davidmz
Copy link
Owner

davidmz commented Jan 12, 2022

It should work that way. Try to check your data, the raw (A)PNG should start from '\x89PNG\x0d\x0a\x1a\x0a' byte sequence.

@dan-toonkids
Copy link
Author

Yes the raw file is ok...
I'm converting between the 'Buffer' and 'ArrayBuffer' using the function suggested here:
https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer
Do you know if that is correct?..
Thanks :)

@davidmz
Copy link
Owner

davidmz commented Jan 12, 2022

Could you show your APNG and the exact conversion code?

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

No branches or pull requests

2 participants