-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Issue Detecting PNG #442
Comments
I am sorry, you need to describe a way to reproduce the issue. Please double check you are using streams correctly, you can only read from a stream once. |
@Borewit Did you see the steps I listed in the original issue for reproducing the issue? You run the |
@Borewit Here is the full step by step reproduction:
EDIT. When I try the latest version it might be OK. Let me know if you see the problem on 15.0.0? |
It was fixed in ec88386 . I had some cached decencies that were using version 15.0.0. Sorry about that and thanks for the fix last year. |
Glad that everything is working. Duplicate of issue #391. |
I have a third party vendor that is providing images that I am attempting to detect what format. The PNG opens fine on a mac, however I get an error when using the library:
When I open the PNG and re-save, it appears to work correctly. I am unaware of how the original images are being generated in this way but they appear to be valid even before re-saving.
wget -O image https://images2.imgbox.com/98/88/UbYCwMuO_o.png?download=true
It seems that the
tokenizer.position
is 2-4 bytes from the length on the last iteration ofwhile (tokenizer.position < tokenizer.fileInfo.size)
which causes it to attempt to read past the length. I can't quite figure out where it is ending up 2-4 bytes short so the final iteration of the do while loop doesn't happen.EDIT. Interestingly when I change the chunk length to
const buffer = readChunk.sync('./image', 0, 4097);
it works, anything above that it fails. I got that line from the README.The text was updated successfully, but these errors were encountered: