Avoid unnecessary compression when no message size limit is set

This commit is contained in:
Moez Bhatti
2018-02-27 22:42:18 -05:00
parent 0450569617
commit b4563e1b9b
@@ -78,7 +78,7 @@ class SendMessage @Inject constructor(
val width = src.width
val stream = ByteArrayOutputStream()
src.compress(Bitmap.CompressFormat.JPEG, quality, stream)
src.compress(Bitmap.CompressFormat.JPEG, 100, stream)
while (maxBytes > 0 && stream.size() > maxBytes) {
step++