Page 1 of 1

Zip file compression metadata curiosity

Posted: Thu Apr 30, 2020 8:25 am
by moon69
Is there any info around on the implementation of Factorio's zip file handling?

I've started using the 'autosave-compression-level=none' option in config.ini, but getting some unexpected values in the file headers of the resulting zip file (well possibly unexpected because I don't fully understand the intricacies of the zip spec!)...

In the usual compressed Factorio save zip, the files are marked as "Deflate" compression method, with level of "Fastest".
In the 'autosave-compression-level=none' zip, the files are also marked as "Deflate" compression method, but with level of "Normal"... and the resulting packed size of the files are all slightly larger than the original uncompressed file size.

What I expected to see was the "Stored" compression method, and the packed size of the files identical to original.

Background: I've an external tool to manage the saves folder - timestamping zip filenames, archiving off to HDD etc. Now I want it to zip the older uncompressed saves in a Factorio compatible format.

Cheers.

Re: Zip file compression metadata curiosity

Posted: Thu Apr 30, 2020 9:38 am
by Optera
Your question made me curious, so i tried repacking safes with 7zip.
deflate works with any compression level
deflate64 reports corrupted file

Re: Zip file compression metadata curiosity

Posted: Thu Apr 30, 2020 2:43 pm
by Jap2.0
Zlib 1.1.4 per this, apparently (as of a few months back) - not sure if that helps.

Re: Zip file compression metadata curiosity

Posted: Thu Apr 30, 2020 8:31 pm
by moon69
Interesting thanks.

Edit:
Rseding91 wrote:
Fri May 01, 2020 2:31 am
I fixed it for the next release so it will mark them as stored when no-compression is used.