zbarimg

1

zbarimg

scan and decode bar codes from image file(s)

          zbarimg
          -qv
          --quiet
          --verbose=n

            -dD
            --display
            --nodisplay
            --xml
            --noxml
            -Ssymbology.config=value
            --set symbology.config=value
            image

          zbarimg

            -h
            --help
            --version

## Description

For each specified ``image`` file `zbarimg` scans the image for bar codes and prints any decoded data to stdout. Images may optionally be displayed to the screen.

The underlying library currently supports EAN-13 (including UPC and ISBN subsets), EAN-8, Code 128, Code 39, and Interleaved 2 of 5 symbologies. The specific type of each detected symbol is printed with the decoded data.

Note that "``image``" in this context refers to any format supported by ImageMagick, including many vector formats such as PDF and PostScript. Keep in mind that vector formats are rasterized before scanning; manually rasterize vector images before scanning to avoid unintentionally corrupting embedded barcode bitmaps.

## Options

This program follows the usual GNU command line syntax. Single letter options may be bundled, long options start with two dashes (`-').

&refcommonoptions;

`-q`

`--quiet`

- Quiet operation; only output decoded symbol data. specifically this disables the statistics line printed (to stderr) before exiting, as well as the warning message printed (also to stderr) when no barcodes are found in an image

`-d`

`--display`

`-D`

`--nodisplay`

- Enable/disable display of subsequent ``image`` files, until next `--display` or `--nodisplay` is encountered. This option may appear multiple times to enable display of specific images. Image display is disabled by default

`--xml`

`--noxml`

- Enable/disable result output using an XML format. This format wraps the raw data from the symbol with information about the scan (such as page indices) in an easy to parse format. The latest schema is available from .

`--raw`

- Enable raw symbol data output. This format prints symbol data separated by newlines without the additional symbology type information that is printed by default

## Examples

Scan a PNG image of a UPC bar code symbol and pass resulting data to a script that searches for the code in a database and does something useful with it:

    zbarimg product.png | upcrpc.py

The `upcrpc.py` example script included in the `examples/` subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found.

Scan a JPEG image containing several barcodes and display the image in a window, also disabling recognition of Interleaved 2 of 5 codes to prevent confusion with other symbologies or background noise:

    zbarimg --display -Si25.disable label.jpg

Look in a scanned document only for Code 39, using XML output format so the page numbers are available. To enable only Code 39, first all symbologies are disabled, then Code 39 is re-enabled:

    zbarimg --xml -Sdisable -Scode39.enable scan.tiff

## See Also

zbarcam

## Bugs

See