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) {
|
||||
val jpegs = jpegsForExport(imageRepository, exportQuality)
|
||||
val timestamp = System.currentTimeMillis()
|
||||
preparationDir.mkdirs()
|
||||
val files = jpegs.mapIndexed { index, bytes ->
|
||||
val file = File(preparationDir, "$timestamp-${index + 1}.jpg")
|
||||
file.writeBytes(bytes)
|
||||
|
||||
Reference in New Issue
Block a user