lowercase the file extension before checking its type

This commit is contained in:
tibbi 2016-10-06 22:32:35 +02:00
parent f635173b1f
commit 58ec3276bb
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
} }
private fun getCompressionFormat(file: File): Bitmap.CompressFormat { private fun getCompressionFormat(file: File): Bitmap.CompressFormat {
return when (file.extension) { return when (file.extension.toLowerCase()) {
"png" -> Bitmap.CompressFormat.PNG "png" -> Bitmap.CompressFormat.PNG
"webp" -> Bitmap.CompressFormat.WEBP "webp" -> Bitmap.CompressFormat.WEBP
else -> Bitmap.CompressFormat.JPEG else -> Bitmap.CompressFormat.JPEG