gildas-lormeau / zip.js

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
https://gildas-lormeau.github.io/zip.js
BSD 3-Clause "New" or "Revised" License
3.39k stars 510 forks source link

Options level does not seem to work #194

Closed gerteb closed 3 years ago

gerteb commented 5 years ago

Hi, I am developing a web-app and need to compress output to server and decompress input from server, since the only way to send webCrypto and openssl encrypted data to and from the server is by base64 encode the encryption output. This way to do it has a huge overhead on more than the double og original data.

I have tried this on BlobWriter in a promise that works: writer.add(next.path, new zip.BlobReader(next), resolve,function(currentIndex, totalIndex){console.log('progress',currentIndex, totalIndex)},{level:6})

The compression ratio does not change no matter what level it is set to. My question is: How do i set the compression level? Either in the options (see https://gildas-lormeau.github.io/zip.js/core-api.html#zip-writing), or in deflate.js, which i believe is the file resposible for compression, if i am not absolutly wrong?

gildas-lormeau commented 3 years ago

I confirm it might not change significantly the level of compression, in fact. You can try to use pako instead, maybe you'll get better results.

gildas-lormeau commented 3 years ago

I'm closing this issue because I won't be able to fix it anyway. Feel free to comment it though.