-
Notifications
You must be signed in to change notification settings - Fork 125
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
Make reductions return a new uncompressed image #158
Conversation
Ouch, dropping worse-compressing reductions has broken tests that expected these reductions |
The test failure on Windows is surprising. I've tested on my Windows machine, with both rayon and without, and it worked fine. I think it could happen if multiple reductions compress to the exact same size, and then the (non-deterministically) last one to compress wins. But a tie in compression size seems quite unlikely. |
It might make sense to make the reduction deterministic, e.g. we should prefer lower bit-depth if there's otherwise a tie. |
Another source of difference was zlib implementation. On very small files (~15 bytes long) file sizes from miniz and cfzlib differ by 1 byte, and cause a different depth to be chosen. |
In the end I've skipped problematic test with miniz. It's an unusual file that compresses over 100KB of data to 890 bytes, and the difference between various modes is just 20 bytes, so it's a very close call. |
Finally ready :) |
…estimation says otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Continues making reductions immutable, and partially fixes #145 and #152