NanaZip icon indicating copy to clipboard operation
NanaZip copied to clipboard

v6 - Zstandard Compression Level selection is broken, resets Compression Method

Open dcog989 opened this issue 4 months ago • 6 comments

NanaZip 6.0 Preview 1 (6.0.1461.0)

  1. Windows Explorer, right click any folder, NanaZip Preview ... Add to Archive...
  2. Archive Format = 7z, Compression Method = Zstandard
  3. change 'Compression Level'
  4. Compression Method is reset to LZMA2

dcog989 avatar Sep 01 '25 14:09 dcog989

I could reproduce this. My hypothesis is due to the uncommenting of SetMethod() in #687.

dongle-the-gadget avatar Sep 01 '25 15:09 dongle-the-gadget

Indeed, it's caused by SetMethod(). The particular reason why is that 7-zip mainline also doesn't attempt to preserve the compression method (try this with official mainline 7-zip and it will reproduce the same). This particular line is commented in 7-zip Zstandard.

@MouriNaruto do you think we should keep mainline behavior or try making it keep the compression method? Commenting back the method will cause the "Store" compression level to break.

dongle-the-gadget avatar Sep 01 '25 16:09 dongle-the-gadget

Maybe we need to try to do a better workaround.

Kenji Mouri

MouriNaruto avatar Sep 01 '25 17:09 MouriNaruto

The mainline has a commented line of SetMethod() that preserves the method, I wonder why it's commented.

dongle-the-gadget avatar Sep 01 '25 17:09 dongle-the-gadget

Emmm, actually, 7-Zip mainline has many changes that I don't understand. I need some time to research.

Kenji Mouri

MouriNaruto avatar Sep 01 '25 17:09 MouriNaruto

Seeing the same, but I'm also wondering if this is related to the number of zstd levels only being limited to 1-9 even though the standard actually goes up to 22? I was migrating from 7-Zip ZS which has the full range of compression levels:

Image

conradsrc avatar Nov 05 '25 01:11 conradsrc