library php-zbarcode
php-zbarcode
mzummo/php-zbarcode
php-zbarcode
- Monday, May 8, 2017
- by mzummo
- Repository
- 1 Watchers
- 0 Stars
- 14 Installations
- C
- 0 Dependents
- 0 Suggesters
- 111 Forks
- 0 Open issues
- 1 Versions
- 27 % Grown
Simple extension to read barcodes from images, (*1)
Basic usage:
<?php
/* Create new image object */
$image = new ZBarCodeImage("test.jpg");
/* Create a barcode scanner */
$scanner = new ZBarCodeScanner();
/* Scan the image */
$barcode = $scanner->scan($image);
/* Loop through possible barcodes */
if (!empty($barcode)) {
foreach ($barcode as $code) {
printf("Found type %s barcode with data %s\n", $code['type'], $code['data']);
}
}
?>
The EAN13 image in the tests/ directory is from
http://en.wikipedia.org/wiki/File:Ean-13-5901234123457.png, (*2)
Dependencies:
ZBar
http://zbar.sourceforge.net/, (*3)
ImageMagick
http://www.imagemagick.org/, (*4)