Fix error when exporting JPEG before a PDF was exported (#101)
This commit is contained in:
@@ -128,6 +128,7 @@ class ExportViewModel(container: AppContainer, val imageRepository: ImageReposit
|
|||||||
): ExportResult.Jpeg = withContext(Dispatchers.IO) {
|
): ExportResult.Jpeg = withContext(Dispatchers.IO) {
|
||||||
val jpegs = jpegsForExport(imageRepository, exportQuality)
|
val jpegs = jpegsForExport(imageRepository, exportQuality)
|
||||||
val timestamp = System.currentTimeMillis()
|
val timestamp = System.currentTimeMillis()
|
||||||
|
preparationDir.mkdirs()
|
||||||
val files = jpegs.mapIndexed { index, bytes ->
|
val files = jpegs.mapIndexed { index, bytes ->
|
||||||
val file = File(preparationDir, "$timestamp-${index + 1}.jpg")
|
val file = File(preparationDir, "$timestamp-${index + 1}.jpg")
|
||||||
file.writeBytes(bytes)
|
file.writeBytes(bytes)
|
||||||
|
|||||||
Reference in New Issue
Block a user