-
Notifications
You must be signed in to change notification settings - Fork 50
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
Allow disabling checksum test for zlib #102
Comments
Yeah this seems reasonable. png actually has double checksums for the sections I think? Using both the zlib one and a CRC checksum in the png format itself, so one could probably save some processing by skipping the zlib one. |
I am not sure whether this is related, or would be better suited in its own issue, but I am a little unsure why the checksum is always turned on in the miniz_oxide/miniz_oxide/src/inflate/stream.rs Line 182 in 19782aa
I thought from looking at the code, that this should depend on the Manually removing this flag (i.e. by |
It's the same thing. Should be easy enough to add an option for it. There isn't any other reason that it it just not being implemented. (EDIT: And it was not an option to ignore it in original C miniz it seems either.) |
Ok, adding a parameter to the InflateState constructors would require some breakage, although it could be done with only very minor breakage by adding an extra variant to DataFormat (which in practice I doubt would break any code using this crate.) That should work fine for now I think. Planning a version bump to raise MSRV #106 in any case so those tho could be done together. Changing the InflateState constructors etc is probably better done together with other larger API changes. |
This is a feature request, motivated by the request to parse a
png
with incorrect checksumThe
png
library also wants to accept this image as it obviously has correct image data and the need for actually checksumming data chunks at rest is dubious at best. It seems thatminiz_oxide
currently always computes and tests the checksum when the flagTINFL_FLAG_PARSE_ZLIB_HEADER
is active.https://docs.rs/miniz_oxide/0.4.4/src/miniz_oxide/inflate/core.rs.html#1619
I had previously assumed that not setting
TINFL_FLAG_COMPUTE_ADLER32
would work but counter intuitively it seems that it the flag is overwritten by the zlib request.The text was updated successfully, but these errors were encountered: