compressiondeflate

Deflated file is larger than original and still valid


Inside a zip, I found this deflated file. It's around 1MB, but when inflated (pako.inflateRaw), the original is just 50kb. How is this possible? What happens to the rest of the data when inflated? I've tried to figure out what's going on by building something to see the rest of the file, but most of it is garbage and I couldn't find where the actual content is.

Link to file: https://github.com/KTibow/hoster/raw/main/file.deflate


Solution

  • Deflate streams are self-terminating. The deflate stream at the start of that file is 17,400 bytes, and decompresses to 49,424 bytes. Then inflate stops.