An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

# zbar-php

[![Latest Version on Packagist](https://img.shields.io/packagist/v/tarfin-labs/zbar-php.svg?style=flat-square)](https://packagist.org/packages/tarfin-labs/zbar-php)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/tarfin-labs/zbar-php/tests?label=tests)
[![Quality Score](https://img.shields.io/scrutinizer/g/tarfin-labs/zbar-php.svg?style=flat-square)](https://scrutinizer-ci.com/g/tarfin-labs/zbar-php)
[![Total Downloads](https://img.shields.io/packagist/dt/tarfin-labs/zbar-php.svg?style=flat-square)](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.