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

#688 in Images

Download history 323/week @ 2024-07-30 589/week @ 2024-08-06 400/week @ 2024-08-13 377/week @ 2024-08-20 435/week @ 2024-08-27 260/week @ 2024-09-03 457/week @ 2024-09-10 260/week @ 2024-09-17 453/week @ 2024-09-24 511/week @ 2024-10-01 353/week @ 2024-10-08 351/week @ 2024-10-15 219/week @ 2024-10-22 285/week @ 2024-10-29 254/week @ 2024-11-05 192/week @ 2024-11-12

1,010 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