fix: prevent processing of empty files in PDF service and scanner watcher
Build and Push Multi-Platform Images / build-and-push (push) Successful in 34s

This commit is contained in:
2026-05-04 16:35:20 +02:00
parent a9c17b45b3
commit 60ac522435
2 changed files with 18 additions and 1 deletions
@@ -40,6 +40,12 @@ export class PdfService {
* Verwendet einen einzigen Ghostscript-Aufruf mit %d-Platzhalter für alle Seiten.
*/
async pdfToImages(pdfPath: string, dpi = 200): Promise<string[]> {
const stat = await fs.stat(pdfPath);
if (stat.size === 0) {
this.logger.warn(`PDF ist leer (0 Bytes), wird übersprungen: ${pdfPath}`);
return [];
}
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'pdf-'));
await execFileAsync('gs', [