Expose more options of the gzip/zlib compress/decompress methods #6348
rvenson
started this conversation in
Engine Core
Replies: 1 comment 2 replies
-
I would recommend adding "MODE_DEFLATE_RAW" which just runs -15 as window bits, exposing window bits globally would probably not be very helpful, if you want both raw and non-raw mode you'd have to mess with global settings and I doubt there would be any great need or reason to pick any other window size than 15 or -15. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have some compressed strings in my project read from an external file. The strings are base64 encoded and compressed using zlib (deflate), containing no header/trailer. I use the following example code to get the final data:
input example:
output expected:
but returns the error:
As my strings have no header, I discovered that I should use a negative value (-15) for the window bits on the decompress, different from the default (15). So I guess there's no way to decompress successfully with GDscript since there's no option to change this parameter. The only option exposed for zlib in the global config is the compression level.
Here are some references to the window_bits options:
Current exposed options for compression
Maybe there are other workarounds, I'm not an expert and I may be missing something, but considering that the compression level parameters are already exposed in the project configs, I suppose that the best option is to expose the
window_bits
value too. The implementation should be uncomplicated, actually, I already made it, but just looking for help to make sure that this is a possible PR.Beta Was this translation helpful? Give feedback.
All reactions