Fix relative path to temporary directory for Tesseract OCR

This commit is contained in:
Benjamin Southall 2017-03-02 11:26:51 +09:00
parent 7f53755f75
commit b4c53e4474

View File

@ -1006,7 +1006,7 @@ if (isset($_POST['delete'])) {
if ($fname == 'spoiler') { // We don't have that much CPU time, do we? if ($fname == 'spoiler') { // We don't have that much CPU time, do we?
} }
else { else {
$tmpname = "tmp/tesseract/".rand(0,10000000); $tmpname = __DIR__ . "/tmp/tesseract/".rand(0,10000000);
// Preprocess command is an ImageMagick b/w quantization // Preprocess command is an ImageMagick b/w quantization
$error = shell_exec_error(sprintf($config['tesseract_preprocess_command'], escapeshellarg($fname)) . " | " . $error = shell_exec_error(sprintf($config['tesseract_preprocess_command'], escapeshellarg($fname)) . " | " .