image-rs/deflate-rs

Proper writer behaviour

oyvindln opened this issue · 0 comments

Write is only supposed to be called one on the wrapped writer in each write call. Currently we call write a fair number of times for each call to {deflate/zlibwriter}::write. In addition to being in violation with the trait, the current implementation assumes that the writer will write all bytes on each write call, which is wrong and can cause compression to fail. We also shouldn't solve this by using write_all internally, see rust-lang/flate2-rs#92