{"id":16616906,"url":"https://github.com/sebastienrousseau/qrc","last_synced_at":"2025-03-21T14:31:30.347Z","repository":{"id":214260858,"uuid":"736035315","full_name":"sebastienrousseau/qrc","owner":"sebastienrousseau","description":"A Rust library for generating and manipulating QR code images in various formats 🦀","archived":false,"fork":false,"pushed_at":"2025-03-03T05:26:18.000Z","size":1583,"stargazers_count":7,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T02:12:10.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastienrousseau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE-APACHE","code_of_conduct":".github/CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sebastienrousseau","custom":"https://paypal.me/wwdseb"}},"created_at":"2023-12-26T19:53:03.000Z","updated_at":"2024-12-24T18:25:08.000Z","dependencies_parsed_at":"2024-01-15T22:13:33.795Z","dependency_job_id":"1428a345-367f-4dc0-b82f-bec04d42bd6b","html_url":"https://github.com/sebastienrousseau/qrc","commit_stats":null,"previous_names":["sebastienrousseau/qrc"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fqrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fqrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fqrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fqrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastienrousseau","download_url":"https://codeload.github.com/sebastienrousseau/qrc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244815199,"owners_count":20514912,"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":[],"created_at":"2024-10-12T02:14:36.738Z","updated_at":"2025-03-21T14:31:30.043Z","avatar_url":"https://github.com/sebastienrousseau.png","language":"Rust","funding_links":["https://github.com/sponsors/sebastienrousseau","https://paypal.me/wwdseb"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003cimg\n    src=\"https://kura.pro/qrc/images/logos/qrc.svg\"\n    alt=\"RustLogs (RLG) logo\"\n    title=\"RustLogs (RLG) logo\"\n    height=\"261\"\n    width=\"261\"\n    align=\"right\"\n/\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n# QRC\n\nA Rust library for generating and manipulating QR code images in various formats 🦀\n\n[![Made With Love][made-with-rust]][05]\n[![Crates.io][crates-badge]][07]\n[![Lib.rs][libs-badge]][06]\n[![Docs.rs][docs-badge]][09]\n[![License][license-badge]][02]\n\n![divider][divider]\n\n## Welcome to QRC\n\n![QRC Banner][banner]\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003ccenter\u003e\n\n**[Website][00]\n• [Documentation][09]\n• [Report Bug][03]\n• [Request Feature][03]\n• [Contributing Guidelines][04]**\n\n\u003c/center\u003e\n\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n## Overview\n\nThe QR Code Library (QRC) is a comprehensive Rust library designed to create and\nmanipulate QR codes. It offers a wide range of functionalities including\ngenerating QR codes in various formats, customizing color schemes, adding image\nwatermarks, and more.\n\n## Features\n\n- Generate QR code images in multiple formats like PNG, JPG, GIF, and SVG,\n- Customize color schemes,\n- Add image watermarks,\n- Easy integration with Rust projects.\n\n### Usage Examples\n\nHere are some basic examples of how to use QRC in your Rust projects:\n\n```rust\n// Create a new QRCode using the QRCode::from_string() function and convert it to a PNG representation\nlet qrcode = QRCode::from_string(URL.to_string());\n\n// Convert the QRCode into a PNG representation\nlet png = qrcode.to_png(512);\n\n// Convert the PNG representation of the QRCode into a vector of bytes\nlet png_data = png.into_raw();\nlet png_image = ImageBuffer::\u003cRgba\u003cu8\u003e, Vec\u003cu8\u003e\u003e::from_raw(21, 21, png_data).unwrap();\n\n// Print the PNG representation of the QRCode\nprintln!(\"fn to_png(): {:?}\", png_image.save(\"qrcode.png\"));\nmatch png_image.save(\"qrcode.png\") {\n    // Print the path to the PNG representation of the QRCode that was saved to a file called \"qrcode.png\"\n    Ok(_) =\u003e println!(\"png file created: qrcode.png\"),\n    // Print the path to the PNG representation of the QRCode that was saved to a file called \"qrcode.png\"\n    Err(e) =\u003e println!(\"png file created: qrcode.png: {e}\"),\n}\n```\n\n## Macros in QRC\n\nThe QR Code Library (QRC) offers a set of macros for easy manipulation and\ngeneration of QR codes in Rust. Below is the documentation for each macro\navailable in the library.\n\n### 1. `add_image_watermark`\n\n- **Description**: This macro creates a new instance of the QRCode struct with a watermark image added to an existing image.\n- **Usage**:\n\n```rust\nadd_image_watermark!(img, watermark);\n```\n\n- `img`: An expression representing the main image.\n- `watermark`: An expression representing the watermark image.\n\n### 2. `qr_code`\n\n- **Description**: Generates a new QR code instance with the provided data.\n- **Usage**:\n\n```rust\nqr_code!(data);\n```\n\n- `data`: An expression representing the data to encode in the QR code.\n\n### 3. `qr_code_to`\n\n- **Description**: Creates a QR code in a specified format (PNG, JPG, or GIF) and size.\n- **Usage**:\n\n```rust\nqr_code_to!(data, format, width);\n```\n\n- `data`: The data to encode.\n- `format`: The desired output format (\"png\", \"jpg\", or \"gif\").\n- `width`: The width of the QR code.\n\n### 4. `resize`\n\n- **Description**: Sets the size of the QR code.\n- **Usage**:\n\n```rust\nresize!(qrcode, size);\n```\n\n- `qrcode`: An instance of `QRCode`.\n- `size`: The desired size for the QR code.\n\n### 5. `set_encoding_format`\n\n- **Description**: Sets the encoding format for the data in a QR code.\n- **Usage**:\n\n```rust\nset_encoding_format!(qr_code, format);\n```\n\n- `qr_code`: An instance of `QRCode`.\n- `format`: The encoding format for the QR code data.\n\n### 6. `overlay_image`\n\n- **Description**: Overlays an image at the center of the QR code.\n- **Usage**:\n\n```rust\noverlay_image!(qr_code, image_path);\n```\n\n- `qr_code`: QRCode instance to which the image will be overlaid.\n- `image_path`: Path to the image file to overlay.\n\n### 7. `batch_generate_qr`\n\n- **Description**: Generates multiple QR codes in one operation.\n- **Usage**:\n\n```rust\nbatch_generate_qr!(data_list);\n```\n\n- `data_list`: A vector of data strings for QR code generation.\n\n### 8. `compress_data_macro`\n\n- **Description**: Compresses data before encoding it into a QR code.\n- **Usage**:\n\n```rust\ncompress_data_macro!(data);\n```\n\n- `data`: The data to be compressed and encoded.\n\n### 9. `combine_qr_codes`\n\n- **Description**: Combines multiple QR codes into a single QR code.\n- **Usage**:\n\n```rust\ncombine_qr_codes!(codes);\n```\n\n- `codes`: An array of QRCode instances to combine.\n\n### 10. `create_dynamic_qr`\n\n- **Description**: Generates a dynamic QR code that can be updated after creation.\n- **Usage**:\n\n```rust\ncreate_dynamic_qr!(initial_data);\n```\n\n- `initial_data`: The initial data for the QR code.\n\n### 11. `create_multilanguage_qr`\n\n- **Description**: Generates QR codes with multi-language support.\n- **Usage**:\n\n```rust\ncreate_multilanguage_qr! {\n    \"en\" =\u003e \"Hello\",\n    \"es\" =\u003e \"Hola\",\n    \"fr\" =\u003e \"Bonjour\",\n};\n```\n\n- Language-data pairs for the QR code.\n\n## Installation\n\nIt takes just a few minutes to get up and running with `qrc`.\n\n### Requirements\n\n`qrc` requires Rust **1.71.1** or later.\n\n## Documentation\n\nYou can find detailed documentation for QRC on [lib.rs][06], [crates.io][07] and\n[docs.rs][08].\n\n## Usage 📖\n\nTo use `qrc` in your project, add the following to your\n`Cargo.toml` file:\n\n```toml\n[dependencies]\nqrc = \"0.0.5\"\n```\n\nAdd the following to your `main.rs` file:\n\n```rust\nextern crate qrc;\nuse qrc::*;\n```\n\nthen you can use the functions in your application code.\n\n### Examples\n\n`QRC` comes with a set of examples that you can use to get started. The\nexamples are located in the `examples` directory of the project. To run\nthe examples, clone the repository and run the following command in your\nterminal from the project root directory.\n\n```shell\ncargo run --example example\n```\n\n## Semantic Versioning Policy\n\nFor transparency into our release cycle and in striving to maintain\nbackward compatibility, `QRC` follows [semantic versioning][09].\n\n## License\n\nThe project is licensed under the terms of both the MIT license and the\nApache License (Version 2.0).\n\n- [Apache License, Version 2.0][01]\n- [MIT license][02]\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms\nor conditions.\n\n![divider][divider]\n\n## Acknowledgements\n\nA big thank you to all the awesome contributors of [QRC][05] for their help and\nsupport. A special thank you goes to the\n[Rust Reddit](https://www.reddit.com/r/rust/) community for providing a lot of\nuseful suggestions on how to improve this project.\n\n[00]: https://qrclib.one\n[01]: http://www.apache.org/licenses/LICENSE-2.0\n[02]: http://opensource.org/licenses/MIT\n[03]: https://github.com/sebastienrousseau/qrc/issues\n[04]: https://raw.githubusercontent.com/sebastienrousseau/qrc/main/CONTRIBUTING.md\n[05]: https://github.com/sebastienrousseau/qrc/graphs/contributors\n[06]: https://lib.rs/crates/qrc\n[07]: https://crates.io/crates/qrc\n[08]: https://docs.rs/qrc\n[09]: http://semver.org/\n\n[banner]: https://kura.pro/qrc/images/titles/title-qrc.svg \"QRC Banner\"\n[crates-badge]: https://img.shields.io/crates/v/qrc.svg?style=for-the-badge \"QRC on Crates.io\"\n[divider]: https://kura.pro/common/images/elements/divider.svg \"divider\"\n[docs-badge]: https://img.shields.io/docsrs/qrc.svg?style=for-the-badge \"QRC on Docs.rs\"\n[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.2-orange.svg?style=for-the-badge \"QRC on Lib.rs\"\n[license-badge]: https://img.shields.io/crates/l/qrc.svg?style=for-the-badge \"QRC License\"\n[made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge\u0026labelColor=c0282d\u0026logo=rust \"Made With Rust\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fqrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastienrousseau%2Fqrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fqrc/lists"}