You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using image-rs to load and validate tiff files produced by an internal software (C++ with libtiff for writing). Until 0.7.1 we could just read those without an issue. Since then and up to 0.8.0 we run into: IoError(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }).
Our debugging
So we debugged into this, originally coming from the image crate and found that it wraps the reader into a bufreader before trying to decode the tiff.
So I added a unit-test to reproduce the issue inside image-tiff which looks like:
While trying to create a minimum example, I also stumbled across the fact, that the image has to be of significant size (35x20px did not fail, 1920x1280 fails). After some chunks (with the attached image its in chunk 6), the PackBitsReader tries to read the header with self.reader.read_exact(&mut header)?; (stream.rs line ~370) and fails out.
Chunk offsets look identical between the readers
Snipped above should reproduce it as unit-test inside decode_images.rs
Any help is greatly appreciated :)
Many thanks in advance for your great work!
The text was updated successfully, but these errors were encountered:
ChrisRega
changed the title
Reading a larger tiff with PackBits fails if original reader is a bufreader
Reading a larger tiff with PackBits fails if original reader is a bufreader, but worked in 0.7.1
Dec 6, 2022
Can you check if #193 fixes it? If so then the working code is completely incidental and was probably previously only masked by some other details (such as a small image size).
Hello!
History
We are using image-rs to load and validate tiff files produced by an internal software (C++ with libtiff for writing). Until 0.7.1 we could just read those without an issue. Since then and up to 0.8.0 we run into:
IoError(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })
.Our debugging
So we debugged into this, originally coming from the image crate and found that it wraps the reader into a bufreader before trying to decode the tiff.
So I added a unit-test to reproduce the issue inside image-tiff which looks like:
While trying to create a minimum example, I also stumbled across the fact, that the image has to be of significant size (35x20px did not fail, 1920x1280 fails). After some chunks (with the attached image its in chunk 6), the
PackBitsReader
tries to read the header withself.reader.read_exact(&mut header)?;
(stream.rs line ~370) and fails out.Chunk offsets look identical between the readers
File for reproduction
Tiff-file is attached gzipped:
screenshot.tif.gz
Snipped above should reproduce it as unit-test inside decode_images.rs
Any help is greatly appreciated :)
Many thanks in advance for your great work!
The text was updated successfully, but these errors were encountered: