Git Product home page Git Product logo

Comments (10)

puzrin avatar puzrin commented on August 20, 2024

Thanks, reproduced, that's deflate bug. Need to investigate. Do you have more broken samples or all others passes ok?

For quick check you can just copy all your files to ./test/fixtures in cloned repo and run make test.

from pako.

puzrin avatar puzrin commented on August 20, 2024

That's NOT *-raw bug, because this code works:

var fs = require("fs");
var pako = require("pako");

var u8 = new Uint8Array(fs.readFileSync("./index"));
console.log(u8.length);

var deflated = pako.deflate(u8, { level: 4, raw: true });
console.log(deflated.length);
var inflated = pako.inflate(deflated, { level: 4, raw: true });
console.log(inflated.length);

but it fails with level > 4. When your sample added to tests, deflate fails at level > 4.

PS. Edited your post for convenience

from pako.

dduponchel avatar dduponchel commented on August 20, 2024

I found the same issue with this small gif file. Strangely, the tests are green when I put it in the test/fixtures folder (but I get the bug when I do the test manually).

from pako.

puzrin avatar puzrin commented on August 20, 2024

Thank you again. I partially fixed bug in master https://github.com/nodeca/pako/commits/master (last commit), that make your first sample work. But found new good sample (previous commit), that crash deflate with ubtyped array and some inflate tests.

To reproduce - rename "_bug" in fixtured to "bug".

from pako.

puzrin avatar puzrin commented on August 20, 2024

@andr83 fixed inflate bug in master. Still need to fix last (i hope) bug in deflate, but you already can continue testing (put your samples to fixtures).

If you find more broken samples - let me know.

from pako.

dduponchel avatar dduponchel commented on August 20, 2024

I got an other one :)
https://github.com/Stuk/jszip/blob/master/test/ref/utf8.zip

from pako.

puzrin avatar puzrin commented on August 20, 2024

Awesome! It reproduces the same bug in deflate, but sample is very small and easy to debug.

from pako.

puzrin avatar puzrin commented on August 20, 2024

Should be ok now. Released 0.1.1

from pako.

dduponchel avatar dduponchel commented on August 20, 2024

I've tested about 400 000 files (my filesystem) without any error. Good job 👍

from pako.

puzrin avatar puzrin commented on August 20, 2024

Cool. Big thanks for help with testing.

from pako.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.