fix mms image compression bug not compressing

This commit is contained in:
gavine99
2025-01-29 18:08:15 +11:00
parent 693533a307
commit 85f200ca17
@@ -429,8 +429,8 @@ class MessageRepositoryImpl @Inject constructor(
attempts++
scaledBytes = when (attachment.getType(context) == "image/gif") {
true -> ImageUtils.getScaledGif(context, attachment.getUri(), maxWidth, maxHeight)
false -> ImageUtils.getScaledImage(context, attachment.getUri(), maxWidth, maxHeight)
true -> ImageUtils.getScaledGif(context, attachment.getUri(), newWidth, newHeight)
false -> ImageUtils.getScaledImage(context, attachment.getUri(), newWidth, newHeight)
}
Timber.d("Compression attempt $attempts: ${scaledBytes.size / 1024}/${maxBytes.toInt() / 1024}Kb ($width*$height -> $newWidth*$newHeight)")