Closed wood1986 closed 4 years ago
Hi, what do you mean by "data length"?
You should use toRGBA8() to decode PNG images, as it is described in README. The output of toRGBA() will be 1024 bytes long.
This array is used for the internal purposes of UPNG.js , just like "ctype" and some other properties. You should not use it for anything. You shoud use UPNG.js according to our README.
I did toRGBA8 before and it was expected. But I did not know it is necessary in order to get the right data.
When I decode this png, the data is in Uint8Array and the length is 1025. The length should be 1024. This image is 256 x 1. If I use RGBA, the total length should be 256 x 4 1024
Use browser console to run this code