Menu

Search toolsChangelog

to move to openDescribe the problem, not the tool

Guide answer

Store or DEFLATE Files in a ZIP?

Store JPEG, MP4, ZIP and other already-compressed files when quick bundling is the main goal; method 0 preserves their bytes and avoids an expensive second compression pass. Try DEFLATE on text, CSV, JSON, logs, source code and uncompressed binary data, where repeated sequences often produce a useful saving. A modern PDF can contain both compressed and uncompressed streams, so compare the measured result if size matters. Either method still gives one ZIP with entry names, boundaries, CRC-32 values and a central directory.

What to take away
  1. ZIP method 0 stores bytes and method 8 compresses them with DEFLATE; both are ordinary interoperable ZIP entries.

  2. JPEG, MP4 and ZIP usually have little redundancy left for DEFLATE, while text and structured data often have plenty.

  3. CRC-32 detects accidental damage but does not authenticate the archive or make it confidential.

The full explanation

ZIP can collect many named files into one artifact with or without compressing them. Method 0 stores source bytes directly; method 8 applies DEFLATE. For already-compressed media, the container and its checksums can be useful even when the resulting ZIP is slightly larger than the loose files. Read the complete guide for the reasoning, examples and definitions behind this answer.

Use the idea

Sources