Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect file size display in upload and source interface #2044

Closed
NSkelsey opened this issue Aug 10, 2017 · 2 comments
Closed

Fix incorrect file size display in upload and source interface #2044

NSkelsey opened this issue Aug 10, 2017 · 2 comments

Comments

@NSkelsey
Copy link
Contributor

Current behavior

When a whistle-blower uploads a file, the reported file size is incorrect. It is not clear if the issue is just in the directive or if the estimation for the file uploader is affected.

Here are some screen shots:

On upload with a comparison of system reported values
inaccurate-upload-sizes

Stored and displayed in frontend
also-stored

Expected behavior

File sizes should match their actual size when downloaded to disk.

Steps to reproduce the problem or feature illustration

Upload a file and observe!

GlobaLeaks version:

Confirmed on v2.70.9

Browser:

Chrome 59

@evilaliv3
Copy link
Member

@NSkelsey: this is not a bug, it's just the difference between kb considered as 1000bytes or 1024bytes.

I remember you already gone into this discussion, let me refind where it was the clarification.

@evilaliv3
Copy link
Member

evilaliv3 commented Aug 10, 2017

Not founding the old conversation but recreating it here.

the reason is that the library that we use to print (angular-filter) consider a kB 1024 bytes while your operating system consider a kB 1000 bytes.

in the real the two are two different units Kb 1000 (Kilobyte) while the other is KiB 1024 (kibibyte )but in the common use are always misused and called both kilobye: https://en.wikipedia.org/wiki/Kilobyte

here the math that solve your issue:

189.9 * 1000 / 1024 = 185.44
146.4 * 1000 / 1024 = 142.95
133.6 * 1000 / 1024 = 130.47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants