-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
small file zip error #112
Comments
That's strange. How did you generate the file ? With compression ? Does other zip files work ? (I don't access to a Windows 8 right now). |
@qlqllu could you also post the zip file and unzipped text file somewhere? |
This is my code that does zip:
@Stuk |
I don't get the issue with
To test with pako, you can do the following : var pako = require("pako");
JSZip.compressions.DEFLATE.compress = function (input) {
return pako.deflateRaw(input);
}; |
@dduponchel |
@dduponchel |
I can't reproduce the bug with your gif file. var fs = require("fs");
var JSZip = require("jszip");
var pako = require("pako");
JSZip.compressions.DEFLATE.compress = function (input) {
return pako.deflateRaw(input);
};
var zip = new JSZip();
var gif = fs.readFileSync("image.gif"); // <- change the file name
zip.file("image.gif", gif);
var data = zip.generate({type: 'nodebuffer', compression: 'DEFLATE'});
fs.writeFileSync("issue_112.zip", data); If you still have the error, could send me (by email for example) the generated zip file ? Regarding pako, it will be soon included inside JSZip see #102. |
My UT can't pass when using pako.
The first UT is from this issue: #89, Could you point out the error in my UT, or could you have a try? |
zlib.js and pako don't have the same implementation and won't produce the same result : that's why your unit tests won't pass ! |
@qlqllu sent me an email with the file ajax-loader.gif and the generated zip file. The generated zip file is corrupted : after decompression, the content doesn't match its crc32. Could you double check that you use the version 0.1.1 of pako ? |
@dduponchel |
@Stuk a bit late but... Should I prepare a v2.2.1 ? |
When I use jszip to zip a small file, result zip file may be not correct on some OS.
On some OS, it's OK.
The small file is a small .js file, contains only one line
This is the error when unzip the file:
![zip-error](https://camo.githubusercontent.com/82a8f4acb79e44f2f969b8d4379136aee45a6be97532d01a2e9deb0c8857c3e3/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313031353830382f323435383838342f34303538633635612d616635322d313165332d393466622d3837323931366663376163652e706e67)
![win8](https://camo.githubusercontent.com/5eb138df2b459678b536a165500a5e884f64b9ca51ac25e68af3af78fc2cf095/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313031353830382f323435383838362f34343462396136632d616635322d313165332d383437652d3337663464373634313064332e706e67)
This is my OS info:
The text was updated successfully, but these errors were encountered: