Skip to content

zbar-php is a php package that provides an interface to the zbar bar-code reading library.

License

Notifications You must be signed in to change notification settings

tarfin-labs/zbar-php

This branch is up to date with master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

81399de · Jul 30, 2024

History

49 Commits
Jul 30, 2024
Jul 30, 2024
Dec 28, 2022
Mar 9, 2020
Mar 9, 2020
Apr 3, 2023
Mar 9, 2020
May 11, 2023
Mar 9, 2020
Mar 9, 2020
Dec 27, 2022
Jul 30, 2024
May 11, 2023

Repository files navigation

zbar-php

Latest Version on Packagist GitHub Workflow Status Quality Score Total Downloads

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 [email protected] instead of using the issue tracker.

Credits

License

zbar-php is open-sourced software licensed under the MIT license.

About

zbar-php is a php package that provides an interface to the zbar bar-code reading library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages