mkoppanen / php-zbarcode

PHP extension for reading barcodes. Uses ImageMagick(http://www.imagemagick.org/) for image support and zbar(http://zbar.sourceforge.net/) for scanning the barcodes.
http://valokuva.org
383 stars 131 forks source link

Question : Barcode position #12

Closed tleluc closed 7 years ago

tleluc commented 9 years ago

Hi mkoppanen,

Is there a way to get barcodes position and bounding box with the php-zbarcode PHP Extension ?

hansallis commented 9 years ago

Absolutely. Just pass true as the third parameter to the scan method in order to retrieve extended information. The second parameter defaults to 1 and indicates the page number. Example output:

array(1) {
  [0]=>
  array(4) {
    ["data"]=>
    string(6) "746120"
    ["type"]=>
    string(4) "I2/5"
    ["quality"]=>
    int(1)
    ["location"]=>
    array(1) {
      [0]=>
      array(2) {
        ["x"]=>
        int(368)
        ["y"]=>
        int(1021)
      }
    }
  }
}