Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Zlib generated does not include proper compression header #65

Closed otavio closed 4 years ago

otavio commented 4 years ago

The generated fine does not include the referred compression level.

It should looks like:

Level | ZLIB  | GZIP 
  1   | 78 01 | 1F 8B 
  2   | 78 5E | 1F 8B 
  3   | 78 5E | 1F 8B 
  4   | 78 5E | 1F 8B 
  5   | 78 5E | 1F 8B 
  6   | 78 9C | 1F 8B 
  7   | 78 DA | 1F 8B 
  8   | 78 DA | 1F 8B 
  9   | 78 DA | 1F 8B 

However, the second byte is always 0x01. This happens using the default feature. Using zlib backend it works as expected.

Originally reported at: https://github.com/alexcrichton/flate2-rs/issues/225

oyvindln commented 4 years ago

This wasn't in the original miniz either, so we never bothered to implement it, but it should be easy enough if it's needed for anything.

otavio commented 4 years ago

This wasn't in the original miniz either, so we never bothered to implement it, but it should be easy enough if it's needed for anything.

It is so it mimics the zlib behavior. For now, I am using it but would prefer to use a pure Rust implementation instead.