feat: compress images before sending

This commit is contained in:
Paul Akhamiogu 2021-09-05 20:45:04 +01:00
parent 72833f6f16
commit 664346e8a9
9 changed files with 241 additions and 15 deletions

View file

@ -0,0 +1,16 @@
package com.simplemobiletools.smsmessenger.extensions
fun String.getExtensionFromMimeType(): String {
return when (this) {
"image/png" -> ".png"
"image/apng" -> ".apng"
"image/webp" -> ".webp"
"image/svg+xml" -> ".svg"
"image/gif" -> ".gif"
else -> ".jpg"
}
}
fun String.isImageMimeType(): Boolean {
return startsWith("image")
}