Comments (5)
Added this to the docs. This will be in the TypeScript IntelliSense in v0.8.1.
from fflate.
Thank you for taking the time to look into this! If I understand your changes correctly, they document the case where a too-small out
buffer is supplied. What about the repro code above, where the input data contains an incorrect size footer?
from fflate.
You're right, I forgot to add that to the docs. Will fix soon.
from fflate.
Bummer, I was hoping for a "real" fix ;) But thanks for taking the time, I appreciate it!
from fflate.
If you really want to, you can ignore the size in the GZIP header by using the streaming API:
import { Gunzip } from 'fflate';
const out = [];
new Gunzip(c => out.push(c)).push(gzipData, true);
const result = out.length !== 1
? new Uint8Array(out.reduce((a, b) => a + b.byteLength, 0))
: out[0];
if (out.length !== 1) {
let offset = 0;
for (const chunk of out) {
result.set(chunk, offset);
offset += chunk.byteLength;
}
}
You can do something similar with AsyncGunzip
but you need to do the concatenation in the callback instead of outside.
from fflate.
Related Issues (20)
- [client side] [encrypted] πwhen extract zip file - check if the zip file is encrypted or protected by a password HOT 2
- zlibSync compressed size is larger than pako HOT 4
- gunzipSync return array with 143.000.000 length HOT 2
- Dictionary support HOT 5
- Deflate stream produces way bigger outputs than Pako HOT 3
- Compression Streams ponyfill for browser HOT 1
- 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
- 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
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.