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

Doesn't work in Arch Linux #61

Open
andrewperoramas opened this issue Feb 29, 2024 · 4 comments
Open

Doesn't work in Arch Linux #61

andrewperoramas opened this issue Feb 29, 2024 · 4 comments

Comments

@andrewperoramas
Copy link

sudo pacman -S leptonica tesseract clang
sudo pacman -S tesseract-data-eng

Tried this in archlinux

I did a cargo run and

cargo run

Finished dev [unoptimized + debuginfo] target(s) in 0.05s
   Running `target/debug/ocr`
[J README  #[3 MIT license =
Productive and safe Rust bindings/wrappers for Tesseract and Leptonica.
Build dependencies
Make sure you have clang, Leptonica and Tesseract installed.
Tesseract should be version 4.0.0 or above.
Ubuntu
sudo apt-get install libleptonica-dev libtesseract-dev clang @
‘You will also need to install tesseract language data based on your OCR needs:
sudo apt-get install tesseract-ocr-eng =]
Mac
brew install tesseract leptonica pkg-config =]

@ccouzens
Copy link
Collaborator

ccouzens commented Mar 2, 2024

Hey,

It's a library rather than a application, so cargo run doesn't work.

What happens when you run cargo test?

You can also run some examples, for example cargo run --example low_level_ocr_full_page

@andrewperoramas
Copy link
Author

andrewperoramas commented Mar 4, 2024

extern crate leptess;

use leptess::{leptonica, tesseract};
use std::path::Path;

fn main() {
    let mut api = tesseract::TessApi::new(None, "eng").unwrap();

    let pix = leptonica::pix_read(Path::new("./r.png")).unwrap();
    api.set_image(&pix);

    let text = api.get_utf8_text();
    println!("{}", text.unwrap());
}


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

I did cargo test in archlinux setup

This setup works in ubuntu wsl but not in my arch machine.

@ccouzens
Copy link
Collaborator

ccouzens commented Mar 4, 2024

I've just tested in an arch linux container

podman container run --rm -it -v "$HOME/Documents/git/github.com/houqp/leptess/:/leptess:Z" docker.io/archlinux
pacman -Sy leptonica tesseract clang tesseract-data-eng rust screenfetch pkg-config

cargo test works, and cargo run --example low_level_ocr_full_page works.

You'll need to give me more information about the problem if I'm going to be able to help you

@andrewperoramas
Copy link
Author

does versions matter? tesseract 5.3.4 , leptonica-1.84.1

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

2 participants