https://github.com/tarfin-labs/zbar-php
zbar-php is a php package that provides an interface to the zbar bar-code reading library.
https://github.com/tarfin-labs/zbar-php
barcode php qrcode zbar
Last synced: 3 months ago
JSON representation
zbar-php is a php package that provides an interface to the zbar bar-code reading library.
- Host: GitHub
- URL: https://github.com/tarfin-labs/zbar-php
- Owner: tarfin-labs
- License: mit
- Created: 2020-03-09T09:06:07.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-31T07:58:18.000Z (9 months ago)
- Last Synced: 2025-02-08T03:04:01.042Z (3 months ago)
- Topics: barcode, php, qrcode, zbar
- Language: PHP
- Size: 59.6 KB
- Stars: 23
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# zbar-php
[](https://packagist.org/packages/tarfin-labs/zbar-php)

[](https://scrutinizer-ci.com/g/tarfin-labs/zbar-php)
[](https://packagist.org/packages/tarfin-labs/zbar-php)## Introduction
zbar-php is a php package that provides an interface to the zbar bar-code reading library.## Requirements
You should have [zbar](http://zbar.sourceforge.net/) and [imagemagick](https://imagemagick.org/) installed.
## Installation
You can install the package via composer:
```bash
composer require tarfin-labs/zbar-php
```## Usage
Scanning bar-code or qr-code with zbar is simple.
``` php
$zbar = new \TarfinLabs\ZbarPhp\Zbar($imagePath);
$code = $zbar->scan();
```Supported file formats: `pdf`, `jpeg`, `jpg`, `svg` and `gif`.
Here is how to get only the type of bar code.
```php
$zbar = new \TarfinLabs\ZbarPhp\Zbar($imagePath);
$type = $zbar->type();echo $type; // "EAN-13"
```And this is how you get both.
```php
$zbar = new \TarfinLabs\ZbarPhp\Zbar($imagePath);
$barCode = $zbar->decode();echo $barCode->code(); // "1234567890128"
echo $barCode->type(); // "EAN-13"
```### Testing
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.
### Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Faruk Can](https://github.com/frkcn)
- [Yunus Emre Deligöz](https://github.com/deligoez)
- [Hakan Özdemir](https://github.com/hozdemir)
- [Turan Karatuğ](https://github.com/tkaratug)
- [All Contributors](../../contributors)### License
zbar-php is open-sourced software licensed under the MIT license.