zetbaitsu / Compressor

An android image compression library.
7.08k stars 963 forks source link

Avoid precision loss for float variable #1

Closed vpop closed 8 years ago

vpop commented 8 years ago

Forced a floating-point division by casting the dividend to avoid the loss of precision for the imgRatio. Previously, it was doing an integral division which truncates the result to the closest integer to zero and then it was casting the result to float.