can't inflate a file compressed with deflate #29

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

Comments

Projects
None yet
2 participants
@dduponchel

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

This comment has been minimized.

Show comment
Hide comment
@imaya

imaya Feb 17, 2014

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@imaya

imaya Feb 20, 2014

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@imaya

imaya Feb 20, 2014

Owner

release version 0.1.9 which includes this fix.

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

This comment has been minimized.

Show comment
Hide comment
@dduponchel

dduponchel Feb 20, 2014

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.

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

This comment has been minimized.

Show comment
Hide comment
@imaya

imaya Feb 21, 2014

Owner

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

Owner

imaya commented Feb 21, 2014

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

@imaya

This comment has been minimized.

Show comment
Hide comment
@imaya

imaya Feb 21, 2014

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@dduponchel

dduponchel Feb 22, 2014

It's working, thanks :)

It's working, thanks :)

@dduponchel dduponchel closed this Feb 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment