-
Notifications
You must be signed in to change notification settings - Fork 12
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: unhandled exception: cannot read from stream [IOError] #55
Comments
And this is also present if I: import base64
import nimPNG
const b = """looong base64"""
writeFile("debug.png",base64.decode(b))
let png = loadPNG("debug.png", LCT_RGBA, 8)
# = > cannot read from stream |
Okay, I had not thought about checking the output image. Using imagemagic convert gives some info on the image created using linux
|
Closed due to my previous comment. It must be my base64 which is malformed. |
Thank you for reporting this. I think it is a good idea to also implement this so called 'relaxed' parsing mode along with 'strict' parsing mode. PNG format consist of chunks of loosely coupled data, if the parser can work in recovery mode perhaps using some progressive scanning method, we can increase the robustness of nimPNG. Technically this is not nimPNG bug, so I will open a new issue and mark it as new feature. |
When trying to parse large base64-string's I get the error:
The base64-string origins from photos taken with iPhones, which then is converted to base64 in the browser. I can't reproduce exactly when this happens, so my guessing is, that it might be due to the details in the photo (?).
I have the base64-strings which works flawless with online converters and linux own
base64 -d p.txt >> p.png
. I have also validated the base64-string, and it is valid base64.Test code:
GH does not like the long base64 string so here is a Gist with it: https://gist.github.com/ThomasTJdev/7a14a8b8309d67a7188c3cfe61eff869
The error message is:
The text was updated successfully, but these errors were encountered: