defold / defold

Defold is a completely free to use game engine for development of desktop, mobile and web games.
https://www.defold.com
Other
4.03k stars 287 forks source link

Zlib: decompression/compression without Zlib headers and Adler32 #5632

Open aglitchman opened 3 years ago

aglitchman commented 3 years ago

Is your feature request related to a problem? Please describe (REQUIRED): I didn't manage to use zlib.inflate to decompress files from .zip archives because zip's compressed data doesn't have a Zlib header (2 bytes) + it has a CRC32 checksum (not Adler32 that is required by Zlib).

Describe the solution you'd like (REQUIRED): An extra argument for zlib.inflate to allow data decompression without Zlib header and checksum. Plus an extra argument for zlib.deflate to get compressed data without headers and checksum, too.

Describe alternatives you've considered: I use the Miniz library as a native extension to extract files from .zip archive. But I would like to write my own .zip tree parser in Lua and to use zlib.inflate for decompression.

britzl commented 3 years ago

We should expose zip.h to the Defold SDK: https://github.com/defold/defold/blob/dev/engine/dlib/src/dlib/zip.h