Add compression level support to ZipPacker
This commit is contained in:
parent
30bb49ec1f
commit
0ed8bf89ae
11 changed files with 229 additions and 2 deletions
|
|
@ -62,6 +62,11 @@
|
|||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="compression_level" type="int" setter="set_compression_level" getter="get_compression_level" default="-1">
|
||||
The compression level used when [method start_file] is called. Use [enum ZIPPacker.CompressionLevel] as a reference.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="APPEND_CREATE" value="0" enum="ZipAppend">
|
||||
Create a new zip archive at the given path.
|
||||
|
|
@ -72,5 +77,17 @@
|
|||
<constant name="APPEND_ADDINZIP" value="2" enum="ZipAppend">
|
||||
Add new files to the existing zip archive at the given path.
|
||||
</constant>
|
||||
<constant name="COMPRESSION_DEFAULT" value="-1" enum="CompressionLevel">
|
||||
Start a file with the default Deflate compression level ([code]6[/code]). This is a good compromise between speed and file size.
|
||||
</constant>
|
||||
<constant name="COMPRESSION_NONE" value="0" enum="CompressionLevel">
|
||||
Start a file with no compression. This is also known as the "Store" compression mode and is the fastest method of packing files inside a ZIP archive. Consider using this mode for files that are already compressed (such as JPEG, PNG, MP3, or Ogg Vorbis files).
|
||||
</constant>
|
||||
<constant name="COMPRESSION_FAST" value="1" enum="CompressionLevel">
|
||||
Start a file with the fastest Deflate compression level ([code]1[/code]). This is fast to compress, but results in larger file sizes than [constant COMPRESSION_DEFAULT]. Decompression speed is generally unaffected by the chosen compression level.
|
||||
</constant>
|
||||
<constant name="COMPRESSION_BEST" value="9" enum="CompressionLevel">
|
||||
Start a file with the the best Deflate compression level ([code]9[/code]). This is slow to compress, but results in smaller file sizes than [constant COMPRESSION_DEFAULT]. Decompression speed is generally unaffected by the chosen compression level.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue