Make the compression_mode
argument of compression related API required
#12496
Labels
compression_mode
argument of compression related API required
#12496
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
The
compression_mode
argument ofPackedByteArray.compress/decompress/decompress_dynamic
andFileAccess.open_compressed
is 0 (COMPRESSION_FASTLZ) by default.This is less than ideal, as it is necessary to ensure the compression methods match during compression and decompression. Generally, you should always explicitly set the compression method rather than relying on default values.
decompress_dynamic
does not support fastlz, so the default value makes no sense.In addition, fastlz is a relatively old compression and doesn't have much advantages compared to modern compression such as zstd or lz4. https://github.com/inikep/lzbench/blob/master/doc/lzbench20_sorted.md. Setting it as the default value seems to imply that we recommend using it.
Related C# binding: godotengine/godot#106008
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Make the
compression_mode
argument required.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Modify the method binding of
PackedByteArray
andFileAccess
to make thecompression_mode
argument required, but this breaks compatibility.If this enhancement will not be used often, can it be worked around with a few lines of script?
N/A
Is there a reason why this should be core and not an add-on in the asset library?
N/A
The text was updated successfully, but these errors were encountered: