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

Support leptonica:1.83.0 #14

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
run: cargo test --verbose --lib
- name: Check formatting
run: cargo fmt -- --check
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "leptonica-sys"
version = "0.4.2"
version = "0.4.3"
authors = ["Chris Couzens <ccouzens@gmail.com>"]
edition = "2018"
links = "lept"
Expand Down
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[cfg(test)]
mod tests {
use super::{pixFreeData, pixRead};
use std::ffi::CStr;
use super::{pixFreeData, pixGetHeight, pixGetWidth, pixRead};

#[test]
fn image_size() {
unsafe {
let image =
pixRead(CStr::from_bytes_with_nul_unchecked(b"../test image.png\0").as_ptr());
assert_eq!((*image).w, 1000);
assert_eq!((*image).h, 500);
let image = pixRead(b"../test image.png\0".as_ptr().cast());
assert_eq!(pixGetWidth(image), 1000);
assert_eq!(pixGetHeight(image), 500);
pixFreeData(image);
}
}
Expand Down