Closed lurch closed 7 years ago
Here's what I know:
npm install yauzl
.All these points are arguments against taking action on this issue and simply resolving it as wontfix. However, I'm willing to consider ways to improve yauzl's feature set and adoption, and if that means either adding a native code dependencies or implementing a decompression algorithm in javascript, I'll at least consider it a little.
What i'd like to do next is do an even more thorough investigation of which zipfile reading libraries support compression methods other than 0 and 8.
It may take a week or so before I have time to do this, so in the immediate future, the direct answer to your question is: No, there are no plans to support compression methods other than 0 and 8.
Ahhh, thanks for the detailed info. I agree that if yauzl relies on zlib, but zlib does not support DELFATE64, then this will be a rather thorny problem to fix. I'll keep monitoring this issue, but I won't be surprised if you close it ;-) In the meantime, I'll try to contact the creators of that zipfile, and suggest they use a different compression method if they want their downloads to be "Etcher friendly".
(cc @jviotti )
I checked the source code for various open source zipfile reading utilities and libraries around the internet, and here's what I found regarding which compression methods are supported:
unrar
did not have zipfile reading capabilities.So my summary is that if you (or your clients or whoever) want compression method 9 to work, you have to use InfoZIP's unzip
utility, which is the one you originally mentioned in this issue, or possibly 7-Zip.
Another possibility is to somehow use PKWARE's proprietary zipfile software, the people who originally made the zipfile format and specification, but I've never heard of anyone actually using their software, so I don't think this is a realistic option.
Wow, thanks for the detailed survey @thejoshwolfe ! :100:
Can anyone link me to any source file in 7-Zip's source code or to a direct download link for an archive file?
I think that's what http://7-zip.org/sdk.html is (at the time of writing, both that page and http://7-zip.org/download.html report the latest version as 17.00 beta
with a date of 2017-04-29
)
Thanks for the tip on 7zip's source code. I found it, finally, and it's a real pain to read. I can't find their list of supported compression methods when reading .zip files, but it actually looks pretty thorough. I expect they do support compression method 9. I've updated my list above with this information.
Yeah, the 7z
command line utility on Ubuntu 14.04 is able to decompress Deflate64
zip archives. It's also able to decompress LZMA
and PPMd
zip files, which InfoZIP's unzip
isn't able to.
I had a rummage around in the 7zip source code and found this in DOC/Methods.txt
(although of course just because an ID is listed it doesn't necessarily mean that 7zip supports it!)
01 - [Zip]
00 - Copy (not used. Use {00} instead)
01 - Shrink
06 - Implode
08 - Deflate
09 - Deflate64
0A - Imploding
0C - BZip2 (not used. Use {040202} instead)
0E - LZMA (LZMA-zip)
5F - xz
60 - Jpeg
61 - WavPack
62 - PPMd (PPMd-zip)
63 - wzAES
The hexadecimal codes in the table above match up with the decimal codes at http://www.winzip.com/comp_info.htm
Thanks for the detailed info, this was super useful and saved me a bunch of research!
7-Zip: probably supports lots of compression methods probably including 9.
FWIW, I've been having this issue with an archive created with 7-Zip (I'm not sure which version, but probably new-ish). It does seem to support compression method 9. 😭
We recently had a report against Etcher that a user was getting a
unsupported compression method: 9
error when trying to extract a particular archive.I downloaded the archive myself, and managed to trace the problem to
yauzl
. When I clone this repo and runnode examples/dump.js --no-contents /home/andrew/Downloads/RPI-CNC-V400.zip
I get this output:Without the
--no-contents
flag I get:Are there any plans for yauzl to support this compression method 9? Wikipedia says https://en.wikipedia.org/wiki/Zip_(file_format)#Compression_methods and
unzip -v /home/andrew/Downloads/RPI-CNC-V400.zip
(on Linux) reports:(and unzip is able to extract the file correctly).