Fix error when exporting JPEG before a PDF was exported (#101)

This commit is contained in:
Pierre-Yves Nicolas
2026-01-22 13:53:39 +01:00
parent 7f4da8dee3
commit 4377868da0

View File

@@ -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)