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 whateverlevelyou 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::ENABLEConfig::ADD_CHECKConfig::EMIT_CHECKConfig::ASCIIConfig::MIN_LENConfig::MAX_LENConfig::POSITIONConfig::X_DENSITYConfig::Y_DENSITY
symbology modifier constants:
Modifier::GS1Modifier::AIM
symbol orientation constants:
Orient::UNKNOWNOrient::UPOrient::RIGHTOrient::DOWNOrient::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::Decoderzbarimg(1),zbarcam(1)http://zbar.sf.net
πΈ AUTHOR πΈ
Jeff Brown, <spadix@users.sourceforge.net> β the original icon, we stan π«Ά
π COPYRIGHT AND LICENSE π
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
- debian trixie: libbarcode-zbar-perl 0.23.93-8
- ubuntu questing: libbarcode-zbar-perl 0.23.93-8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms