tarfin-labs / zbar-php
zbar-php is a php package that provides an interface to the zbar bar-code reading library.
Installs: 38 000
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 3
Forks: 10
Open Issues: 2
Requires
- php: ^7.2|^7.3|^7.4|^8.0|^8.1|^8.2|^8.3
- ext-imagick: *
- symfony/process: ^4.4|^5.0|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^8.5|^9.0|^10.0
This package is auto-updated.
Last update: 2024-12-01 00:14:55 UTC
README
Introduction
zbar-php is a php package that provides an interface to the zbar bar-code reading library.
Requirements
You should have zbar and imagemagick installed.
Installation
You can install the package via composer:
composer require tarfin-labs/zbar-php
Usage
Scanning bar-code or qr-code with zbar is simple.
$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.
$zbar = new \TarfinLabs\ZbarPhp\Zbar($imagePath); $type = $zbar->type(); echo $type; // "EAN-13"
And this is how you get both.
$zbar = new \TarfinLabs\ZbarPhp\Zbar($imagePath); $barCode = $zbar->decode(); echo $barCode->code(); // "1234567890128" echo $barCode->type(); // "EAN-13"
Testing
composer test
Changelog
Please see CHANGELOG 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 development@tarfin.com instead of using the issue tracker.
Credits
License
zbar-php is open-sourced software licensed under the MIT license.