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
Build and Push Multi-Platform Images / build-and-push (push) Successful in 34s
This commit is contained in:
@@ -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', [
|
||||
|
||||
Reference in New Issue
Block a user