|
|
@ -436,8 +436,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
FileInputStream(image).use { input -> |
|
|
|
FileInputStream(image).use { input -> |
|
|
|
if (uri.isContentScheme()) { |
|
|
|
if (uri.isContentScheme()) { |
|
|
|
DocumentFile.fromTreeUri(context, uri)?.let { doc -> |
|
|
|
DocumentFile.fromTreeUri(context, uri)?.let { doc -> |
|
|
|
DocumentUtils.createFileIfNotExist(doc, image.name) |
|
|
|
val imageDoc = DocumentUtils.createFileIfNotExist(doc, image.name)!! |
|
|
|
context.contentResolver.openOutputStream(doc.uri)!!.use { output -> |
|
|
|
context.contentResolver.openOutputStream(imageDoc.uri)!!.use { output -> |
|
|
|
input.copyTo(output) |
|
|
|
input.copyTo(output) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|