photopea / UPNG.js

Fast and advanced PNG (APNG) decoder and encoder (lossy / lossless)
MIT License
2.1k stars 259 forks source link

Running into issue with cnum=0 and image with less than 256 colors #20

Closed martin19 closed 6 years ago

martin19 commented 6 years ago

Thanks for your compressor, it works very well.

https://github.com/photopea/UPNG.js/blob/5e5af183a3dda1e320b90a1830b3f64bc92010d4/UPNG.js#L511

should it say var img32 = new Uint32Array(bufs[j].buffer) in this line?

photopea commented 6 years ago

No, since "bufs" has to be an array of ArrayBuffers (i.e. not Uint8Array or Uint32Array). It will probably work with ArrayBufferViews, too, but it would be slower and use more RAM.