DataCompression icon indicating copy to clipboard operation
DataCompression copied to clipboard

Can you make custom compression levels

Open Mikebanana opened this issue 3 years ago • 1 comments

Always compressed level 5 is too rigid

Mikebanana avatar Apr 13 '22 08:04 Mikebanana

Hi! Unfortunately Apples Compression Framework does not allow special compression flags to be passed to the underlaying algorithm. I thought, Apple would add it one day, and then I would of course too, but that never happened.

Your only option is to use zlib directly if you want to change the compression level. If you are willing to go down that road, may I recommend taking a look at my code here, it shows how to load a function pointer from the zlib dynamically at runtime.

Also I'm pretty sure there is a clean Swift wrapper around libz out there as well.

mw99 avatar Apr 13 '22 10:04 mw99