Skip to content
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

Support compression levels >= 10 and use zstd's internal default level. #730

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion minizip.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ int main(int argc, const char *argv[]) {
else if ((c == 'v') || (c == 'V'))
options.verbose = 1;
else if ((c >= '0') && (c <= '9')) {
options.compress_level = (c - '0');
options.compress_level = (int16_t)atoi(&argv[i][1]);
if (options.compress_level == 0)
options.compress_method = MZ_COMPRESS_METHOD_STORE;
} else if ((c == 'b') || (c == 'B'))
Expand Down
2 changes: 1 addition & 1 deletion mz_strm_zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ int32_t mz_stream_zstd_set_prop_int64(void *stream, int32_t prop, int64_t value)
switch (prop) {
case MZ_STREAM_PROP_COMPRESS_LEVEL:
if (value < 0)
zstd->preset = 6;
zstd->preset = 0; // Use zstd default.
else
zstd->preset = (int16_t)value;
return MZ_OK;
Expand Down