aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.96k stars 615 forks source link

filesize in bytes #632

Open PolGuixe opened 7 years ago

PolGuixe commented 7 years ago

Is it possible to optain the filesize in bytes? the filesize getter returns a string e.g. '1.8MB'.

amber-cd commented 5 years ago

Did anyone ever figure this out? I've tried splitting it with a regex to pull out the number and units and then multiplying according to the multiplier, but the problem is that this doesn't seem to give me exact figures... a 19,382,069 byte file might just give me 19,398,656 bytes (18.5 * 1024^2) because the size only gives me 18.4.