Comments (10)
$ 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.
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.
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.
It shouldn't fail with a cryptic error for synchronous. Why not fix it to work via (pos / 8) >> 0
?
from fflate.
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.
@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.
Check v0.4.4 on the NPM registry. Thanks for the bug report!
from fflate.
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.
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.
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)
- Deflate/Inflate does not work with zlib/gzip c++ HOT 7
- Add Bzip2?
- Hangs on gunzipSync of compressed content with invalid dictionary HOT 3
- Option to shorten output as much as possible HOT 3
- Incorrect argument order in AsyncFlateStreamHandler HOT 5
- Truncated output of gunzip if SIZE footer is incorrect HOT 5
- return uncompressed size instead of resized output buffer HOT 4
- Improve zip documentation HOT 1
- The encoded data was not valid for encoding utf-8 HOT 1
- Streams onData do not work as expected anymore HOT 8
- CDN bundle for 0.8.1 is broken HOT 2
- Async unzip maxing out CPU and memory for some files HOT 3
- fflate.decompressSync is not a function when using `nifti-reader-js` (React) HOT 7
- Occasional CRC Errors When Streaming Data into Zip using AsyncZipDeflate HOT 7
- `zipSync` can get order of ZIP entries wrong, due to how objects work HOT 3
- delete the rust code
- The 2nd+ JPG images in a zip stream being created are corrupt for some reason? HOT 9
- `gunzipSync` failing (0 gzip length) on some npm package tarballs HOT 1
- Unexpected EOF when inflating ZIP HOT 3
- Unzip error thrown when big file as compression type 9 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fflate.