photopea / UPNG.js

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

Why use UZIP only when the data length is greater than 10e6? #79

Closed xuejianxianzun closed 1 year ago

xuejianxianzun commented 1 year ago
var CMPR = (data.length>10e6 && UZIP!=null) ? UZIP : pako;

The file size of UZIP is much smaller than pako, so I want to use UZIP. Why is there such a condition? What if I always use UZIP? Thank you!

photopea commented 1 year ago

I dont think UZIP always works better than pako. But you can rewrite it to var CMPR = UZIP.

xuejianxianzun commented 1 year ago

OK. In my test case, UZIP compressed 18% faster and 1% larger than pako. I have set to always use UZIP.