mat2 changes zip files compression level (use case: reproducible builds)
In ZipParser, when creating new zip files, the compression is hardcoded to zipfile.ZIP_DEFLATED.
As I understand, mat2 main use case is to remove the metadata from files, so I guess that in this case, if mat2 changes the compression of the zip files it's not an issue.
However here my use case is a bit different: I want to generate several zip files with inside a png file and a text file to create a bootanimation.zip for an Android distribution. The zip files are generated with a script from a single svg file.
In order to make it reproducible, I used mat2, which makes the zip reproducible, but it also changes the compression of the zip from ZIP_STORED (no compression), to zipfile.ZIP_DEFLATED, and Android only accepts uncompressed zips.
This bug is probably similar to the bug #158 (closed).
Would it be desirable (or not) to enable mat2 to detect the zip compression and, when recreating the zip, to reuse the same compression level.
And if it's useful, it could also be dangerous in some situation, for instance if some zip files are somehow watermarked through the compression level of the zip or individual files.
So if adding the ability to use the same compression level makes sense, would it also make sense to add some option to use mat2 for reproducible builds?
It could look like that in the man:
Keep the compression level of the various formats (at this time only zip is implemented).