-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to extract files from ZIP file with version 45 #1
Comments
Good catch. It should be possible to update the version of zlib in src/3rdparty, but I've not tried to do so and there may be some problems I've not forseen |
Actually I'm using the zlib that ships with Qt which appears to be version 1.2.5 as well. I'm not sure why Qt ships with such an old zlib header, but on the other hand I doubt a little that this would be the reason for the incompatibility since there's just patch releases in between. |
According to: https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.3.TXT The version 45 means "File uses ZIP64 format extensions". |
ah, so likely some "real" work to change how we are using zlib |
Well, I've hacked it up to get it to work with my zip file. Will look into opening a pull request later, though it'll be mainly to show the rough changes because for sure it won't have all the proper error handling in place. In my case I did not need to change anything regarding the way zlib is used, because the actual ZIP file did not contain any files larger than 4 GB. Rather it was for whatever reason using this ZIP64 extension to store the compressed and uncompressed file systems in an extra field. This is valid according to the standard, and it seems to be not too complicated to support that. I think actually supporting larger amounts of data would be really hard, maybe impossible with the current API. The reason being that QByteArray can't store more than about 2 GB of data, or am I missing something? It just uses 'int' for its size, at least. Also, zip version 2.7 added a "File is a patch data set" flag that will now probably need to be reported as unsupported. |
For future reference, this could be useful for implementing full ZIP64 support since it contains some useful links and patches to OpenJDK that added support for that: https://blogs.oracle.com/xuemingshen/entry/zip64_support_for_4g_zipfile |
This is probably not complete and it's not well tested, but it allowed me to open a zip file with version 45 that was using the ZIP64 extension. GitHub-issue: nezticle#1
This code apparently only supports ZIP files up to version "20", and the file I tried to read with it appears to be version "45". This results in the message:
I know this library is unmaintained and only meant as a starting point for a full featured ZIP file reader/writer for Qt, but I thought I'd document this shortcoming here for reference.
The text was updated successfully, but these errors were encountered: