{"id":17656465,"url":"https://github.com/marhkb/zbars","last_synced_at":"2025-05-07T11:43:50.029Z","repository":{"id":32330098,"uuid":"132270055","full_name":"marhkb/zbars","owner":"marhkb","description":"High-level rust bindings to the zbar library","archived":false,"fork":false,"pushed_at":"2022-01-27T21:02:00.000Z","size":210,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-30T15:48:43.281Z","etag":null,"topics":["barcode-reader","barcode-scanner","rust","rust-bindings","zbar"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marhkb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-05T17:31:04.000Z","updated_at":"2024-11-22T01:30:55.000Z","dependencies_parsed_at":"2022-08-07T17:15:51.290Z","dependency_job_id":null,"html_url":"https://github.com/marhkb/zbars","commit_stats":null,"previous_names":["marhkb/zbar-rs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhkb%2Fzbars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhkb%2Fzbars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhkb%2Fzbars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhkb%2Fzbars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marhkb","download_url":"https://codeload.github.com/marhkb/zbars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873875,"owners_count":21817708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode-reader","barcode-scanner","rust","rust-bindings","zbar"],"created_at":"2024-10-23T14:32:53.551Z","updated_at":"2025-05-07T11:43:50.010Z","avatar_url":"https://github.com/marhkb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zbars\n##### Renamed from zbar-rs\n\n[![crates.io version][1]][2] [![build status][3]][4]\n[![downloads][5]][6] [![docs.rs docs][7]][8]\n\n# High-level rust bindings to the zbar library\nJust started implementing a high-level rust binding to zbar barcode scanner library.\nSome things already work, but there is still a lot to do. So don't expect this to work without flaws.\nAnd expect things to break!\n\n# Building and Running\nYou need `zbar native library` in order to build `zbars`.\n\n## Linux\nOn Linux you can simply install zbar development package. The build script uses\n`pkg-config` to probe for zbar native library.\n\n### Ubuntu:\n\n    # apt install libzbar-dev\n\n### Arch Linux\n\n    # pacman -S zbar\n\nFeature `zbar_fork_if_available` is enabled by default and builds the crate against\nzbar `0.2` which is a more recent fork (https://github.com/procxx/zbar) if found by `pkg-config`.\n\nNothing special to consider when running your binary on Linux.\n\n## Windows\nBuilding on Windows is a little bit uncomfortable. I only tested it on x64 with MSVC toolchain.\nAt first you must download this [ZBar Visual Studio project](https://github.com/dani4/ZBarWin64).\nYou can either build the project or just use the prebuilt binaries in the project's `lib` directory.\nThen set the following environment variables to be able to build:\n\n    ZBAR_LIB_DIR=\"build output directory or directory where prebuilds are stored\"\n    ZBAR_INCLUDE_DIR=\"directory where zbar.h is stored (usually named include)\"\n\n\nIn order to run you also need to compile [libiconv](https://www.gnu.org/software/libiconv/) or download `libiconv.dll` from somewhere else.\nBoth `libzbar64-0.dll` from lib directory and `libiconv.dll` have to be copied to the directory where\nyour binary is.\n\n# Usage\nScan an image for QR codes:\n```\nextern crate zbars;\n\nuse zbars::prelude::*;\n\npub fn main() {\n    let image = ZBarImage::from_path(\"test/qr_hello-world.png\")\n        .expect(\"unable to create image\");\n\n    let scanner = ZBarImageScanner::builder()\n        .with_config(ZBarSymbolType::ZBAR_QRCODE, ZBarConfig::ZBAR_CFG_ENABLE, 1)\n        .build()\n        .unwrap();\n\n    let symbol_set = scanner.scan_image(\u0026image)\n        .expect(\"error on scanning image\");\n\n    symbol_set.iter()\n        .for_each(|symbol| {\n            println!(\"symbol decoded: {}\", symbol.data());\n            symbol.polygon().iter()\n                .enumerate()\n                .for_each(|(i, point)| {\n                    println!(\"{}. point: {:?}\", i, point);\n                })\n        });\n}\n```\n\n[1]: https://img.shields.io/crates/v/zbars.svg?style=flat-square\n[2]: https://crates.io/crates/zbars\n[3]: https://img.shields.io/travis/marhkb/zbars.svg?style=flat-square\n[4]: https://travis-ci.org/marhkb/zbars\n[5]: https://img.shields.io/crates/d/zbars.svg?style=flat-square\n[6]: https://crates.io/crates/zbars\n[7]: https://docs.rs/zbars/badge.svg\n[8]: https://docs.rs/crate/zbars\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarhkb%2Fzbars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarhkb%2Fzbars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarhkb%2Fzbars/lists"}