amwps 1KB (kilobytes) is defined as 1024 bytes, not 1000 bytes
You are thinking bit to byte or something ... kilo means 1000, so 1000 bytes is 1 kilobyte.
I checked the PHP filesize() for that file, and it outputs 130719
bytes, and 130719
bytes is ~ 130.72 kb
, so the math is correct.
So Files Gallery and filesize.js is therefore showing the correct number according to what PHP reports. On my file system both local and on server, I see 131kb
:
Exactly why you get a different or smaller file size I don't know, but it's something else. For example, your network or proxy may be re-compressing the image for faster output. Or maybe some meta data was removed. Cloudflare does this sometimes also, although it should not be configured like that. It could be something on your file system, I really don't know. All I know, is that PHP reports the file size in bytes, correctly, according to how much space it requires on the server file system ... And filesize.js correctly converts the bytes to human readable, which is bytes divided by 1000 and rounded.
amwps Modify it
Math.pow(1e3,$))
to
Math.pow(1024,$))
This is just a coincidence in your case. Do you think a popular script with lots of contributors and 9 major versions can't do the math correctly?
https://github.com/avoidwork/filesize.js/