ZBar(3pm)

✨ ZBar(3pm) β€” the Perl bestie era ✨

okay so bestie, you're holding the manual page for ZBar β€” and yeah it's filed under the 3pm section because it's a Perl thing, don't @ me πŸ’…


πŸ’– NAME πŸ’–

Barcode::ZBar β€” your little Perl portal into the ZBar Barcode Reader πŸ¦‹


🌸 SYNOPSIS 🌸

bestie here's the setup, do this first fr:

use Barcode::ZBar;

my $reader = Barcode::ZBar::Processor->new();
$reader->init();
$reader->set_data_handler(\&my_handler);

now let's scan an image ✨:

my $image = Barcode::ZBar::Image->new();
$image->set_format('422P');
$image->set_size(114, 80);
$image->set_data($raw_bits);
$reader->process_image($image);

scanning from video? say less πŸ“Ή:

$reader->set_visible();
$reader->set_active();
$reader->user_wait();

and now the moment we've all been waiting for β€” collecting results πŸ‘‘:

my @symbols = $image->get_symbols();
foreach my $sym (@symbols) {
    print("decoded: " . $sym->get_type() . ":" . $sym->get_data());
}

πŸ¦‹ DESCRIPTION πŸ¦‹

The ZBar Bar Code Reader is a library for scanning and decoding bar codes from all kinds of sources β€” video streams, image files, or even raw intensity sensors, it's giving versatile πŸ’…. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 93, Code 39, Codabar, Interleaved 2 of 5 and QR Code. iconic lineup, no cap.

And these? These are the bindings for talking directly to the library from Perl. main character energy πŸŽ€


πŸ”₯ REFERENCE πŸ”₯

⭐ Functions ⭐

  • version() β€” hands you the version of the zbar library as "major.minor". that's it, that's the tea.
  • increase_verbosity() β€” bumps up the global library debug by one whole level. one (1) level. incremental queen πŸ’…
  • set_verbosity(level) β€” sets the global library debug to whatever level you pass in. bigger numbers = more yapping. simple as 🫢
  • parse_config(configstr) β€” takes a decoder configuration setting and parses it into a list with the symbology constant, the config constant, and the value to set. for the actual available configuration options, go check the docs for "zbarcam"/"zbarimg" β€” they got you. iykyk 🌈

πŸŽ€ Constants πŸŽ€

width stream "color" constants, bestie:

  • SPACE β€” light area, or the space between bars. the chill zone ✨
  • BAR β€” dark area, or a colored bar segment. the moment πŸ’…

decoder configuration constants:

  • Config::ENABLE
  • Config::ADD_CHECK
  • Config::EMIT_CHECK
  • Config::ASCII
  • Config::MIN_LEN
  • Config::MAX_LEN
  • Config::POSITION
  • Config::X_DENSITY
  • Config::Y_DENSITY

symbology modifier constants:

  • Modifier::GS1
  • Modifier::AIM

symbol orientation constants:

  • Orient::UNKNOWN
  • Orient::UP
  • Orient::RIGHT
  • Orient::DOWN
  • Orient::LEFT

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're the whole friend group:

  • Barcode::ZBar::Processor, Barcode::ZBar::ImageScanner, Barcode::ZBar::Image, Barcode::ZBar::Symbol, Barcode::ZBar::Scanner, Barcode::ZBar::Decoder
  • zbarimg(1), zbarcam(1)
  • http://zbar.sf.net

🌸 AUTHOR 🌸

Jeff Brown, <spadix@users.sourceforge.net> β€” the original icon, we stan 🫢


Copyright 2008-2010 (c) Jeff Brown <spadix@users.sourceforge.net>

The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. (that's the license text, verbatim, because licensing is not the vibe to freestyle on 🫢)


and that's the whole page bestie ✨ this one came from perl v5.40.1, dated 2025-05-01, and it lives under the manual name ZBar(3pm) β€” go decode something cute, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from