forked from mkoppanen/php-zbarcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
36 lines (23 loc) · 645 Bytes
/
README
File metadata and controls
36 lines (23 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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/