-
-
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:
This is my OS info:
The text was updated successfully, but these errors were encountered: