Fix: Form-Feed-Zeichen von pdftotext verhinderte OCR-Fallback [deploy]
All checks were successful
Deploy mahnung / deploy (push) Successful in 14s
All checks were successful
Deploy mahnung / deploy (push) Successful in 14s
pdftotext gibt bei Bild-PDFs 0x0C (Form Feed) zurück — trim() entfernt das nicht. Dadurch wurde der OCR-Fallback nie ausgelöst. Jetzt trim() mit expliziter Zeichenliste inkl. \x0C. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f776d121c5
commit
7157f0d8c3
1 changed files with 1 additions and 1 deletions
2
card.php
2
card.php
|
|
@ -206,7 +206,7 @@ if ($action === 'scan_belege' && $user->hasRight('mahnung', 'write')) {
|
|||
if ($pdftotextAvailable) {
|
||||
// Erst normales pdftotext versuchen
|
||||
$cmd = 'pdftotext -layout '.escapeshellarg($file['fullname']).' - 2>/dev/null';
|
||||
$text = trim((string) @shell_exec($cmd));
|
||||
$text = trim((string) @shell_exec($cmd), " \t\n\r\0\x0B\x0C");
|
||||
|
||||
// Kein Text? → OCR via ocrmypdf (Bild-PDF lesbar machen)
|
||||
if ($text === '') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue