Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron: ln -s apps/images_ocr/tess is not a directory #4

Open
jlaba opened this issue Apr 6, 2017 · 0 comments
Open

cron: ln -s apps/images_ocr/tess is not a directory #4

jlaba opened this issue Apr 6, 2017 · 0 comments

Comments

@jlaba
Copy link

jlaba commented Apr 6, 2017

The cron script echos the error above. I think the relative path to apps/images_ocr is not correct, when called with system cron. Currently I'm not able to figuring out the correct path, but introduced an extra check in app.php, to make sure the path is an existing directory, which might be useful in generall (s. first line of code, which is line 85 in app.php):

    if (is_dir('apps/images_ocr') && !file_exists('apps/images_ocr/tess')) {
        $depth = 1;

        while ($depth < MAX_DEPTH_CHECK) {
            $depth += 1;
            exec('find / 2>/dev/null -maxdepth '.$depth.' -name "tessdata" -type d', $result);
            printf($result);
            if ($result != null && strlen($result[0]) > 0) {
                exec('ln -s '.$result[0].' apps/images_ocr/tess');
                break;
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant