-
Notifications
You must be signed in to change notification settings - Fork 232
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
Set the compression method and level for JlCompress #192
Comments
The proposal makes sense to me on the surface. Some comments.
|
for comment 1: Of course, function overloading is possible. But to overload all compression functions just for one line, I feel it's unnecessary. Or we can first overload those functions, and after these functions have been validated for a period of time, then proceed with the merge. for comment 2: In quazipfile.h, line 364, there is an explanation for the QuaZipFile::open function. The method can take three values, 0 means no compression, Z_DEFLATED (8) uses the default compression method, and Z_BZIP2ED (12) uses the bzip2 library for compression. The definition of level is also explained, with 0 indicating a very low compression level.
for comment 3: I can prepare a pull request, but I haven't used the bzip2 library. If using only the default compression method is acceptable, I can give it a try, because JlCompress also uses the default compression method. |
On point 1, I think using default arguments would still break the ABI which is not desirable. See CONTRIBUTING.md point 1. |
Okay, I understand. I will try to spend a few days to overload the functions and conduct testing. After everything is done, I will submit a pull request. |
Implemented in #206 |
Currently, when using the API in JlCompress, I can only compress files or directories, and the compression level is very high (or in other words, the compression ratio is very high), which takes some time.
However, sometimes I just want to package files without compression. Or I want to set a lower compression level to reduce the compression time.
However, in the JlCompress API, there is no way to set the compression method and compression level. Therefore, I wonder if it is possible to set the compression method and compression level in JlCompress.
For example,
In the JlCompress.h file, change
to
Then, in the JlCompress.cpp file, change
to
JlCompress's other compression APIs can also be rewritten in this way. This way, when we compress, we can set the compression method and compression level.
The reason for this setting is because after reviewing the source code, I observed that when the method is 0, it will only package without compression. When the method is 8, the higher the level value, the higher the compression degree, the higher the compression ratio, and the longer the compression time.
Finally, I want to ask if JlCompress can be modified in the way mentioned above?
The text was updated successfully, but these errors were encountered: