Skip to content

Commit

Permalink
added missing dot for file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
davotoula committed Oct 8, 2024
1 parent da47965 commit c5e3657
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ object MediaCompressorFileUtils {
context: Context,
): File {
val extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(context.contentResolver.getType(uri)) ?: ""
val tempFile = File.createTempFile(UUID.randomUUID().toString(), extension)
val suffix = if (extension.isNotEmpty()) ".$extension" else ""
val tempFile = File.createTempFile(UUID.randomUUID().toString(), suffix)

context.contentResolver.openInputStream(uri)?.use { inputStream ->
FileOutputStream(tempFile).use { outputStream ->
Expand Down

0 comments on commit c5e3657

Please sign in to comment.