mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-31 16:15:58 +00:00
Fix: narrow zstd compression level to the conventional -22..22 range
The raw library bounds (-131072, 22) come from an internal zstd implementation constant (-ZSTD_TARGETLENGTH_MAX), not a meaningful distinct level — deeper negative values than -22 buy nothing over -22 in practice, and the zstd CLI/community convention only uses -22..22. Exposing the raw range via --zip-compression-level would let a user pass a number like -50000 that "validates" but means nothing.
This commit is contained in:
@@ -78,6 +78,8 @@ class TestLevelError:
|
||||
("deflated", 9),
|
||||
("bzip2", 1),
|
||||
("bzip2", 9),
|
||||
("zstd", -22),
|
||||
("zstd", 22),
|
||||
("deflated", None),
|
||||
("stored", None),
|
||||
],
|
||||
@@ -100,6 +102,8 @@ class TestLevelError:
|
||||
("deflated", -1),
|
||||
("bzip2", 0),
|
||||
("bzip2", 10),
|
||||
("zstd", -23),
|
||||
("zstd", 23),
|
||||
],
|
||||
)
|
||||
def test_out_of_range_levels_return_message(
|
||||
|
||||
Reference in New Issue
Block a user