Closed fursund closed 1 year ago
Hi! Interesting. Can you provide the file? What error exactly to you encounter, a panic?
Mixing the channel types is tested in the library, so I'm pretty confident that mixing the channels is not the cause. I would like to have a look whether anything else might be the problem :)
Thanks! I'll have a look :)
Thanks! It worked before miniz introduction in the lib.
You mean, before using the zune-inflate
dependency for decompression (#183)? Or before using miniz-oxide
(#162)?
Before miniz-oxide https://github.com/johannesvollmer/exrs/pull/162
Interesting. Good to know.
You think the expected byte size is calculated incorrectly? What error does it result in?
Error is: "thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Invalid("compressed ZIP1 data (invalid: zlib-compressed data malformed)")'". Yeah my guess was that the expected byte size was wrong.
Thanks for sharing! I'll have a look as soon as I can :)
If I remove ".set_limit(expected_byte_size)" here: https://github.com/johannesvollmer/exrs/blob/66a247789004d974043300daf7bfc57c7d52a459/src/compression/zip.rs#L22 then it works
some findings:
Output limit exceeded, set limit was 393,216 and output size is 392,539
note that output is actually smaller than the limitset_limit
on zlib no longer returns an errordecompress_image_section
https://github.com/johannesvollmer/exrs/blob/66a247789004d974043300daf7bfc57c7d52a459/src/compression/mod.rs#L232
(note, this is the same expected_size
variable computed earlier with pixel_section.size.area() * header.channels.bytes_per_pixel
)theory:
the data is decompressed to the correct size, but zune-inflate reports an error when a limit is set, even though the limit is set to that exact size of the uncompressed data. the error message limit was 393,... and output size is 392,...
shows that the data is smaller than the expected size, but an error is returned nevertheless.
here's the compressed data blob which results in the error: zlib-compressed-binary 393216 bytes.zip this is it, decompressed: zlib-compressed-binary 393216 bytes decompressed.zip, decompressed.len() = 393216
asked for help from our friends at zune-inflate
they fixed it incredibly fast, it's already online! now, be sure to run cargo update
and then check if it works :)
great thanks!
alright, reopen this issue if the problem persists :)
this file must be added to the repository to detect this problem in the future
Please respond swiftly if you give the exrs project permission to use this file for testing purposes :) I will include it in the repository in that case
Yes you can use it for testing
awesome, thanks!
https://github.com/johannesvollmer/exrs/blob/66a247789004d974043300daf7bfc57c7d52a459/src/compression/mod.rs#L200
We're hitting in issue where channels are mixed between half and float, and it seems it might fail at this particular line of code?