I built ZIP Shrinker, a little browser tool to shrink ZIP files. It also works with formats that are secretly ZIPs underneath, like APK, EPUB, JAR, and many more. Try it out! How does it work? At a high level, this tool (1) re-compresses every file in the ZIP archive with higher compression (2) removes all metadata (3) removes entries for directories. Re-compressing ZIP files are typically compressed with an algorithm called Deflate. There are a few tools that can re-compress Deflate data and make it smaller, usually by spending more time on the computation. I took one of these tools, libdeflate, and applied it to each compressed entry in the ZIP. I chose libdeflate because of its performance; alternatives like Zopfli can achieve marginally smaller results but take much longer. I created libdeflate.js, a WebAssembly wrapper for libdeflate, as part of this work. (I always relish my time working with WASM!) Removing metadata and directories Each entry in a ZIP file can contain…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.