Commit 1967ae7
committed
Tolerate missing LZW end-of-information marker
Some TIFF encoders (e.g., UK Environment Agency LiDAR DTM tiles)
omit the LZW end-of-information code. Previously `LZWReader::read`
returned UnexpectedEof on `NoProgress` even when that same call had
already decoded valid pixel bytes — discarding them and failing the
whole image.
This change returns any output produced in a `NoProgress` call.
A subsequent read that produces zero output still errors, so a
genuinely truncated stream is still caught by `read_exact`.
Matches the LZW portion of image-rs#386 (dropped upstream
pending a wider decoder-API rework). Carried by madri until upstream
lands an equivalent fix.1 parent e41159c commit 1967ae7
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
| |||
0 commit comments