-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compression method Deflate is unsupported #131
Comments
Looking at the code a bit deeper, it does seem there are |
I played around a bit, it appears that "Adobe Deflate" has the same Zlib-compatible header, and if I change I'll play around a bit more and make a PR - now running into another issue with the |
Hm, the |
Looks like it's calculated as multiplication of these two numbers, which are the same for uncompressed or compressed variant of the same image:
|
I think I see what's happening... looks like that length is meant to be for a tile not for the whole file, so the error is misleading (I guess that's what image-tiff/src/decoder/stream.rs Lines 142 to 143 in a874b9c
|
UPD: fixed that too, now battling with satisfying the crate's MSRV... 1.34.2 is fairly restrictive by now, are there any plans to lift that? |
Ah, it only needs to build, not to test, so I can ignore criterion's errors. That's easier. |
- 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 image-rs#131.
Fix & other improvements in #132. |
I'm trying to use
image
crate to read TIFF images produced (compressed) by ImageMagick with-compress zip
. My understanding is thatimage
crate relies on this one to do actual reading, so raising issue here.This is what Exiftool reports on those images:
README suggests that decoding Deflate TIFFs should be supported:
However, when trying to read them using
image::open
, I'm getting:Am I holding it wrong? Or is there some specific to this "Adobe Deflate" that ImageMagick uses that makes it different from Deflate supported by this crate?
The text was updated successfully, but these errors were encountered: