files larger than 100MB still compressed due to 7z -m0=lzma2 flag
A folder sync tool with encryption
Brought to you by:
steveking
In source code, line 930 of FolderSync.cpp
the comment says "turn off compression for files bigger than 100MB"
However, even with the flag -mx0, 7z would still compress the file because -m0=lzma2 is present
Simplest solution would be to remove the -m0=lzma2 flag, since 7z uses lzma2 by default anyway.
lzma2 is not on by default, because that's the encryption algorithm to be used. lzma2 has nothing to do with compression but only with encryption.
Surely lzma2 refers to the compression algorithm.
It's on by default according to 7z documentation. Also consistent with the many tests I did
7z format only uses AES for encryption, no other choices
references:
https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#MethodID
https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#LZMA2
https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Markov_chain_algorithm
http://www.7-zip.org/7z.html
https://en.wikipedia.org/wiki/7z#Encryption
screenshot from 7zip GUI
With -m0=lzma2 and -mx0, files get compressed with effect of -mx1
Without -p"password", "-mx0 -m0=lzma2" and "-mx1" produces the exact same output.
Without -m0=lzma2, -mx0 functions properly without compression. Encryption still works with -p"password"
These are verifiable with tests, as I have done.
There's no option for encryption algorithm when using -t7z, because 7z format only supports AES
Ups, sorry. My fault. I mixed lzma2 with sha2.
That's okay
Yes, -mx0 works as "copy without compression" when -m0=lzma2 is not present.
But when -m0=lzma2 is present, -mx0 effectively becomes -mx1
"-mx0 -m0=lzma2" and "-mx1" produces the exact same output (without -p"password).
All I said above is backed up with tests I did, not just from reading documentation