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

can't inflate a file compressed with deflate #29

Closed
dduponchel opened this issue Feb 14, 2014 · 7 comments
Closed

can't inflate a file compressed with deflate #29

dduponchel opened this issue Feb 14, 2014 · 7 comments

Comments

@dduponchel
Copy link

As reported on Stuk/jszip#97, deflate/inflate fails for some files.
With the file export17.idbql (in this zip file), the following code fails :

var zlibjs = require("zlibjs");
var fs = require("fs");
var assert = require("assert");

var original = fs.readFileSync("export17.idbql");

var compressed = zlibjs.deflateSync(original);
var decompressed = zlibjs.inflateSync(compressed);

assert.equal(original.length, decompressed.length);
console.log("OK");

I get the error AssertionError: 1000049 == 390085 : the decompressed content is not the same as the original.

@imaya
Copy link
Owner

imaya commented Feb 17, 2014

Thank you for bug report.
There seems to be a problem in LZSS coding of Deflate.
Please wait for a while because investigate.

imaya pushed a commit that referenced this issue Feb 20, 2014
@imaya
Copy link
Owner

imaya commented Feb 20, 2014

As a result of investigation, it was a Inflate bug.
I've thought it's RLE context of HDIST and HLIT is different, but the two seem to have had should be treated as if it were continuous.

@imaya
Copy link
Owner

imaya commented Feb 20, 2014

release version 0.1.9 which includes this fix.

imaya pushed a commit that referenced this issue Feb 20, 2014
@dduponchel
Copy link
Author

Thanks !

Something seems wrong with the npm package : the website displays an error (I've opened the issue npm/npm-www#624) and the package 0.1.9 doesn't seem to exist :

npm ERR! notarget No compatible version found: zlibjs@'>=0.1.9-0 <0.2.0-0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.7","0.1.8"]

The json at https://registry.npmjs.org/zlibjs displays the release date and an attachment for the version 0.1.9 but no 0.1.9 version... that's strange.

@imaya
Copy link
Owner

imaya commented Feb 21, 2014

sorry...
Please wait a little because it had failed to npm publish

@imaya
Copy link
Owner

imaya commented Feb 21, 2014

0.2.0 released.
Possible to publish by changing the version number...
No content changed, please try this!

@dduponchel
Copy link
Author

It's working, thanks :)

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