|
@@ -79,15 +79,15 @@ |
|
|
block discarded – undo |
|
79
|
79
|
$newName = \OCP\Files::buildNotExistingFileName($srcDir,$srcFile.'_OCR.pdf'); // new filename (and in case it exists already it will be build other way) |
|
80
|
80
|
$success = $this->ocrmypdf($fileInfo, $newName, $language); |
|
81
|
81
|
$message = $success ? 'OCR_SUCCESS' : 'OCR_ERROR'; |
|
82
|
|
- }elseif ($mtype == 'image/png' || $mtype == 'image/jpeg' || $mtype == 'image/tiff'){ |
|
|
82
|
+ } elseif ($mtype == 'image/png' || $mtype == 'image/jpeg' || $mtype == 'image/tiff'){ |
|
83
|
83
|
$newName = \OCP\Files::buildNotExistingFileName($srcDir,$srcFile.'_OCR.txt'); // new filename (and in case it exists already it will be build other way) |
|
84
|
84
|
$success = $this->tesseract($fileInfo, $newName, $language); |
|
85
|
85
|
$message = $success ? 'OCR_SUCCESS' : 'OCR_ERROR'; |
|
86
|
|
- }else{ |
|
|
86
|
+ } else{ |
|
87
|
87
|
$success = false; |
|
88
|
88
|
$message = 'WRONG_MIMETYPE'; // wrong mimetype |
|
89
|
89
|
} |
|
90
|
|
- }else{ |
|
|
90
|
+ } else{ |
|
91
|
91
|
$success = false; |
|
92
|
92
|
$message = 'WRONG_PARAMETERS'; // parameters not set |
|
93
|
93
|
} |
Please login to merge, or discard this patch.