Comments (4)
Hey @chiarelli.
I'm not exactly sure, but I think that the rounding needs to use ceil
instead of floor
here, and therefor is a bug.
I will look into this asap.
Do you have more information or a sample file for me?
from node-split-file.
@chiarelli Released 2.1.0 for fixing this issue. I've not pushed it as a bugfix as it's chaging some behaviour.
Thanks for posting this issue!.
from node-split-file.
The truncation problem also occurs in text files when using the "splitFileBySize ()" method, but with the "splitFile ()" method this problem does not occur.
When I changed the code of the "splitFileBySize ()" method:
---
// Number of parts (exclusive last part!)
var parts = Math.floor(totalSize / maxSize);
---
for:
---
// Number of parts (exclusive last part!)
var parts = (totalSize / maxSize);
---
The problem was apparently solved.
I believe that when size can not be rounded.
However, I believe it is more prudent to do more testing.
from node-split-file.
Any file (binary or not) when it is splitted using splitFileBySize() and then merged results in a truncated file.
As an example you could try a zip file. As an example you could try a zip file: split it and then merge it, will result in a truncated file and different from the original (you will not be able to unzip it).
from node-split-file.
Related Issues (20)
- Convert to promises HOT 4
- Code style improvements.
- Add unit tests to ensure the functionalities and quality.
- Update README.md with new syntax.
- Out of memory when splitting file that is bigger than 500mb HOT 2
- .splitFileBySize() not working HOT 2
- function splitFileBySize problem HOT 3
- An in-range update of jest is breaking the build 🚨 HOT 1
- Version 10 of node.js has been released
- An in-range update of bluebird is breaking the build 🚨 HOT 2
- split by size does not work HOT 9
- An in-range update of bluebird is breaking the build 🚨 HOT 6
- splitFile and splitFileBySize return empty object HOT 2
- Splitting XLXS filetype HOT 5
- splitFile throws an error: expecting a function but got [object Undefined] HOT 1
- Add typescript support
- TypeError: self.__splitFile is not a function
- Use promises
- Split video file to stream from browser 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 node-split-file.