Improve deflate support
- Switch to streaming decompression via `flate2`. Aside from performance improvements and lower RAM consumption, this fixes a bug where `max_uncompressed_length` was precalculated for a single tile but then used as a hard limit on the whole data, failing to decompress any tiled images. - Deprecate `InflateError` - this was used for wrapping `miniz_oxide` raw status, but `flate2` already reports them as `io::Error` instead. This makes errors from both Lzw and Deflate modes more consistent - they're all now just `io::Error`. - Add support for new `Deflate` tag in addition to `OldDeflate` - format-wise it's same Zlib, and on practice decodes successfully with the same underlying code. - Slightly simplify partial reads from the `Reader` by using the `std::io::copy` helper instead of doing it manually. Fixes #131.
This commit is contained in:
1 parent
a874b9c3a5
commit
a6fb855121
5 files changed
+18
-78
No files matched your search
+1
-4
@@ -20,10 +20,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
weezl = "0.1.0"
|
||||
jpeg = { package = "jpeg-decoder", version = "0.1.17", default-features = false }
|
||||
|
||||
[dependencies.miniz_oxide]
|
||||
version = "0.4.1"
|
||||
features = ["no_extern_crate_alloc"]
|
||||
flate2 = "1.0.20"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.1"
|
||||
|
||||
Reference in new issue
Block a user