-
Notifications
You must be signed in to change notification settings - Fork 259
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
Uncaught RangeError: byte length of Uint32Array should be a multiple of 4 #74
Comments
Did you read the documentation properly? The input of UPNG.encode() should be a raw picture in the RGBA format (four bytes per pixel). The length of your input array is not a multiple of 4. E.g. if your image has one pixel, the input length is 4. If it has 2 pixels, the input length is 8. If the length of your input is 7, it makes no sense (maybe the red value of the second pixel is missing, only you know it). |
In your example, rgba8Img is an array of frames, while [rgba8Img ] is an array with an array of frames. That is not the right input for UPNG.encode() |
You should set the "cnum" parameter in UPNG.encode(), to for a lossy compression. E.g. try 256 or 50. |
I try UPNG.encode with several pictures, all of which reported the following errors
The text was updated successfully, but these errors were encountered: