GithubHelp home page GithubHelp logo

magiclen / zbar-rust Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 12.0 51 KB

High-level and low-level ZBar binding for the Rust language.

License: GNU Lesser General Public License v2.1

Rust 100.00%
rust zbar

zbar-rust's Introduction

ZBar Rust

CI

High-level and low-level ZBar binding for the Rust language.

Compilation

To compile this crate, you need to compile the ZBar library first. You can install ZBar in your operating system, or in somewhere in your file system. As for the latter, you need to set the following environment variables to link the ZBar library:

  • ZBAR_LIB_DIRS: The directories of library files, like -L. Use : to separate.
  • ZBAR_LIBS: The library names that you want to link, like -l. Use : to separate. Typically, it is iconv:zbar.
  • ZBAR_INCLUDE_DIRS: The directories of header files, like -i. Use : to separate.

Examples

use zbar_rust::ZBarImageScanner;

use image::GenericImageView;

let img = image::open(INPUT_IMAGE_PATH).unwrap();

let (width, height) = img.dimensions();

let mut scanner = ZBarImageScanner::new();

let mut results = scanner.scan_y800(img.into_luma8().into_raw(), width, height).unwrap();

for result in results {
    println!("{}", String::from_utf8(result.data).unwrap())
}

More examples are in the examples folder.

Crates.io

https://crates.io/crates/zbar-rust

Documentation

https://docs.rs/zbar-rust

License

LGPL-2.1

zbar-rust's People

Contributors

magiclen avatar rksm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zbar-rust's Issues

环境变量设置问题

在windows平台下环境变量好像一定会出现:
比如: C:\Program Files (x86)\ZBar\lib
则会报错,因为:的出现导致环境变量被分成了C 和\Program Files (x86)\ZBar\lib

Build fails on zbar > 0.20

zbar-rust currently requires zbar <= 0.20 to be installed in the system, otherwise the build fails with ZBar version must be no higher than 0.20. Arch Linux has zbar 0.23.1, and the 3-years-old version 0.20.0 doesn't seem to build with gtk3-based dependencies and Python 3.9.

See build log for Authenticator, which depends on zbar-rust: build-output-authenticator.txt

Can the required version be raised so zbar-rust can build on Arch Linux and other distros?

The latest release doesn't link properly

It appears that the latest release only includes Cargo.toml and stuff in /src and it should also include build.rs so that it can run to determine where to find libraries and where to link to them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.