18 releases

0.4.8 May 31, 2024
0.4.7 Nov 4, 2023
0.4.6 Jul 25, 2023
0.4.4 Feb 26, 2023
0.2.1 Jul 6, 2019

#540 in Images

Download history 463/week @ 2024-06-20 362/week @ 2024-06-27 232/week @ 2024-07-04 297/week @ 2024-07-11 392/week @ 2024-07-18 331/week @ 2024-07-25 386/week @ 2024-08-01 538/week @ 2024-08-08 417/week @ 2024-08-15 360/week @ 2024-08-22 395/week @ 2024-08-29 443/week @ 2024-09-05 271/week @ 2024-09-12 390/week @ 2024-09-19 474/week @ 2024-09-26 314/week @ 2024-10-03

1,663 downloads per month
Used in 14 crates (3 directly)

MIT license

16KB
104 lines

leptonica-sys

Rust FFI bindings to Leptonica.

Types and functions generated from the functions listed in allheaders.h.

Help wanted

Windows and Mac maintainers wanted.

Building

This links to the C library Leptonica.

On Fedora 30 the build dependencies can be installed by running:

sudo dnf install leptonica-devel clang

On Termux 2019 (Android, Android on Chromebooks) the additional dependencies can be installed by running:

pkg install libclang leptonica-dev

Building on Windows

On Windows, this library uses Microsoft's vcpkg to provide leptonica.

Please install vcpkg and set up user wide integration or vcpkg crate won't be able to find the library. By default vcpkg installs 32 bit libraries. If you need 64 bit libraries then set following environment variable

SET VCPKG_DEFAULT_TRIPLET=x64-windows

To install leptonica

REM from the vcpkg directory
.\vcpkg install leptonica

vcpkg allows building either dynamically or statically linked application

if you prefer dynamic linking

SET VCPKGRS_DYNAMIC=true

for statically linked libraries

SET RUSTFLAGS=-Ctarget-feature=+crt-static

If you prefer to compile tesseract yourself (Because, for example, you could not get vcpkg to build using clang-cl.exe), you can set these environment variables: LEPTONICA_INCLUDE_PATH, LEPTONICA_LINK_PATHS and LEPTONICA_LINK_LIBS.

For example:

set LEPTONICA_INCLUDE_PATH=D:\leptonica\build\include
set LEPTONICA_LINK_PATHS=D:\leptonica\build\lib
set LEPTONICA_LINK_LIBS=leptonica-1.83.0

Dependencies

~0–1.9MB
~38K SLoC