This commit is contained in:
Thibault Deckers 2025-05-23 18:59:49 +02:00
parent ef091b9932
commit 3bcaab9a4b
2 changed files with 2 additions and 0 deletions

View file

@ -710,6 +710,7 @@ class MediaStoreImageProvider : ImageProvider() {
// note that `DocumentFile.getParentFile()` returns null if we did not pick a tree first
val targetTreeFile = targetDirDocFile.createFile(mimeType, targetNameWithoutExtension)
val targetDocFile = DocumentFileCompat.fromSingleUri(activity, targetTreeFile.uri)
// TODO TLAD [missing extension] check whether targetDocFile.name has a valid extension
try {
targetDocFile.openOutputStream().use(write)

View file

@ -168,6 +168,7 @@ object MimeTypes {
HEIC, HEIF -> ".heif"
MP2T, MP2TS -> ".m2ts"
PSD_VND, PSD_X -> ".psd"
// TODO TLAD [missing extension] check whether to define more manual mapping and raise exception on miss
else -> MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType)?.let { ".$it" }
}