feat: compress images before sending
This commit is contained in:
parent
72833f6f16
commit
664346e8a9
9 changed files with 241 additions and 15 deletions
|
|
@ -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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue