Skip to content
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

Zip generated by jszip can't be parsed by jszip (but is valid) #97

Closed
David-Mulder opened this issue Feb 13, 2014 · 4 comments
Closed

Comments

@David-Mulder
Copy link

The 'attached' zip has been generated by jszip, but triggers a Bug : uncompressed data size mismatch error despite working in windows explorer and 7zip test function reporting no errors. The easiest way to reproduce this error is downloading the zip file below and running zip.files["export17.idbql"].asText() on it. And just to be clear here, all the other files do work correctly.

Zip file triggering bug: https://apriol.com/hosting/dev/myFile%20(13).zip

I mean, I am 'fine' with jszip not being able to open every zip file out there, but at the very least it should support its own zip files. Hope this can be quickly resolved, because I would love using this function in my app.

@dduponchel
Copy link
Collaborator

I can reproduce the bug with your file and the following nodejs script :

var JSZip = require("jszip"), fs = require('fs');
var zip = new JSZip();
zip.file("export17.idbql", fs.readFileSync("export17.idbql"));
var buffer = zip.generate({type:"nodebuffer", compression:"DEFLATE"});
(new JSZip(buffer)).files["export17.idbql"].asText();

If I replace the assertion on the size with a log, I get the following sizes : decompressedContentSize = 390085, expectedSize = 1000049 and the following content :

PUT [{"k":"BT","vvvvp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000...

It may be a bug with the compression library, I will investigate that tomorrow (almost midnight Paris time).

@David-Mulder
Copy link
Author

That's odd, I am sure I wrote an entire comment this morning here, but it seems it never got submitted. Oh well, boils down to it that the 'competing' zip library was able to parse it neatly, so I switched to that one for the time being. And good luck guys fixing this I guess :)

@dduponchel
Copy link
Collaborator

Ok, thanks for the bug report :)

@dduponchel
Copy link
Collaborator

Upstream fixed it, and the update has been merged !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants