Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PHP extension for reading barcodes. Uses ImageMagick(http://www.imagemagick.org/) for image support and zbar(http://zbar.sourceforge.net/) for scanning the barcodes.
Branch: master
Pull request Compare This branch is 12 commits behind mkoppanen:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc/en/reference/zbarcode
tests
README
config.m4
php_zbarcode.h
zbarcode.c

README

Simple extension to read barcodes from images

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




Dependencies:

ZBar 
http://zbar.sourceforge.net/

ImageMagick
http://www.imagemagick.org/
Something went wrong with that request. Please try again.