mcmilk / 7-Zip-zstd

7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
https://mcmilk.de/projects/7-Zip-zstd/
Other
5.18k stars 301 forks source link

Zstandard inside zip, PKWARE method 20 #193

Closed klauspost closed 3 years ago

klauspost commented 3 years ago

Seems like PKWARE decided to use method 20 for zstd inside zip: https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.7.TXT

Because why use the value everyone else use?

Either way. It seems like it should be trivial to add that as a supported decompression method.

Here is a sample zip: zstdzip.zip. file1.txt is WinZip (method 93) and file2.txt is method 20, PKWARE.

I have been unable to download PKWARE zip software, so unfortunately I have been unable to confirm that this is the correct method. This is from my own library.

mcmilk commented 3 years ago

I had written a email to both, and method id93 was the result in the end, see this issue: https://github.com/mcmilk/7-Zip-zstd/issues/132#issuecomment-638434730

If you take a look into the next pkware versions, the notes to zstd changes: https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.8.TXT

But of cause, we could add method id 20 for decompression only ... will you create an PR or should I do in the next release ?

klauspost commented 3 years ago

@mcmilk Yeah, decompression only would be neat.

I don't have a dev env set up currently, so I can't submit a PR (that I've tested anyway). Sorry for that.

mcmilk commented 3 years ago

I will do it into the next release...

ghost commented 3 years ago

In 21.02 Alpha, Igor has added both IDs (20 and 93).

This means that 7-Zip 21.02 can recognize ZIP entries which use Zstd, but since upstream 7-Zip does not support Zstd, it cannot decompress them.

mcmilk commented 3 years ago

I have added decompression of id=20 ... testing needs to be done, but I think it will work with 21.02 release.

mcmilk commented 3 years ago

Works