Giter VIP home page Giter VIP logo

Comments (10)

101arrowz avatar 101arrowz commented on May 16, 2024
$ unzip test-0001.zip 
Archive:  test-0001.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of test-0001.zip or
        test-0001.zip.zip, and cannot find test-0001.zip.ZIP, period.

Even the CLI fails to unzip it. However, you are correct that Windows can unzip this natively, and so can 7zip, so I'll look into the issue and see what the problem is.

from fflate.

lutzroeder avatar lutzroeder commented on May 16, 2024

Can you double check the total file size of test-0001.zip is 655042854 bytes?

~/: unzip test-0001.zip 
Archive:  test-0001.zip
  inflating: test-0001        

The actual error is bit positions getting larger than 32 bit so JavaScript >>> won't work.

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

That's true, I should mention the limit of 512 MB on synchronous unzip. However, streaming inflate does work on larger files, so I'll see if that works for this.

Yes, you were right, that was a PEBKAC, this ZIP is valid. I'll fix this by adding support for streaming when files become too large.

from fflate.

lutzroeder avatar lutzroeder commented on May 16, 2024

It shouldn't fail with a cryptic error for synchronous. Why not fix it to work via (pos / 8) >> 0?

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

I decided against that because I was worried that the division operator followed by a bit shift would be much more expensive than a single bit shift, but as it turns out what you suggested isn't any slower. I was thinking of (and just now finished) making the synchronous operation default to synchronous streaming when files were too large, but I suppose that's not as performant as your suggestion.

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

@lutzroeder I've finished making changes to support the full 4GB maximum supported by Uint8Array itself. Thanks for the suggestions, help, and debuggable examples ❤️ I'll be pushing an update shortly.

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

Check v0.4.4 on the NPM registry. Thanks for the bug report!

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

Hey @lutzroeder, I noticed you added a subsection of fflate into netron. I understand that depending upon the NPM package would be difficult, since netron's build process doesn't allow for tree shaking, but I would appreciate if you could still attribute the project in the source code or README. Thanks for your interest!

from fflate.

lutzroeder avatar lutzroeder commented on May 16, 2024

Reverted the change. The main fork is a rewrite from scratch using the reverse mapping algorithm from UZIP.js and has a UZIP.js reference added to the source.

from fflate.

101arrowz avatar 101arrowz commented on May 16, 2024

The algorithm is actually from SO, you may want to cite that instead. Nothing special about the change except shift down a bit, since they're all 15 bit integers I managed to find a way to optimize further. Either way, hope your rewrite works well.

from fflate.

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.