houqp / leptess

Productive and safe Rust binding for leptonica and tesseract
https://houqp.github.io/leptess/leptess/index.html
MIT License
259 stars 29 forks source link

Suppressing std output logs #50

Closed yosefahab closed 1 year ago

yosefahab commented 1 year ago

Is there a way to suppress logs like (Estimating resolution as X) from being printed to the std output? its really slowing down the performance.

houqp commented 1 year ago

I am pretty sure there is a way to configure the logging verbosity in the C API, we just need to find it and expose it through the Rust interface.

f2calv commented 1 year ago

@yosefahab you can get rid of the warning by calling set_source_resolution explicitly after set_image (more info), i.e.

let mut lt = leptess::LepTess::new(None, "eng").unwrap();
lt.set_image(img_uri).unwrap();
//in my case my source JPGs are 96 dpi
lt.set_source_resolution(96);