GD::Ba...:QRcode(3pm)

✨ GD::Barcode::QRcode ✨

okay bestie, gather round, because this is the GD::Barcode::QRcode manual page β€” it's a lil Perl module (a 3pm one, if you're keeping track) and it literally makes QR code barcode images with GD. yes. actual QR codes. you're gonna eat this up πŸ’–


🌸 NAME 🌸

GD::Barcode::QRcode β€” Create QRcode barcode images with GD

no cap, that's the whole job description. it makes QR code barcode images, and it does it with GD. πŸŽ€


🌈 SYNOPSIS 🌈

here's the vibe, ex. CGI:

use GD::Barcode::QRcode;
binmode(STDOUT);
print "Content-Type: image/png\n\n";
print GD::Barcode::QRcode->new('1234567')->plot->png;

and with UnitSize, ECC settings, because we do love options:

my $oGdBar = GD::Barcode::QRcode->new('123456789',
                          { Ecc => 'L', Version=>2, ModuleSize => 20}
                      );

look at that. one-liner to a PNG in the first one, and full control in the second. iconic behavior fr fr ✨


πŸ’… DESCRIPTION πŸ’…

GD::Barcode::QRcode is a subclass of GD::Barcode and allows you to create QRcode barcode images with GD. it's giving inheritance, it's giving reusability, it's giving slay. πŸ¦‹

also important, and I'm quoting this exactly because it's the origin story: this module based on "QRcode image CGI version 0.50 (C)2000-2002,Y.Swetake".

so yeah, shoutout to Y.Swetake, the blueprint πŸ’œ

🫢 new

$oGdBar = GD::Barcode::QRcode->new($sTxt,
                    { Ecc => Ecc Mode,
                      Version => Version,
                      ModuleSize => Size of 1 module,
                    });

Constructor. Creates a GD::Barcode::QRcode object for $sTxt. this is the moment where your text becomes a whole object. main character energy tbh.

Parameters:

  • Ecc β€” Ecc mode. select 'M', 'L', 'H' or 'Q' (Default = 'M'). pick your error-correction energy, bestie.
  • Version β€” Version ie. size of barcode image (Default = auto select). so you can pick the size, or you can just let it choose for you. no thoughts, head empty, auto select 😌
  • ModuleSize β€” Size of modules (barcode unit) (Default = 1).

✨ plot()

$oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);

creates GD object with barcode image for the $sTxt specified at new method. $iHeight is height of the image. If NoText is 1, the image has no text image of $sTxt.

ex.:

my $oGdB = GD::Barcode::QRcode->new('1234567');
my $oGD = $oGdB->plot();
# $sGD is a GD image with Height=>20 pixels, with no text.

boom. GD object. ready to .png your way into greatness πŸ”₯

🌟 barcode()

$sPtn = $oGdBar->barcode();

returns a barcode pattern in string with '1' and '0'. '1' means black, '0' means white. so it's literally the whole barcode as a string of ones and zeroes. the way that this is just binary and also art?? 😭

ex.:

my $oGdB = GD::Barcode::QRcode->new('1234567');
my $sPtn = $oGdB->barcode();

πŸ’œ $errStr

$GD::Barcode::QRcode::errStr

has error message. if something goes sideways, check here β€” she will tell you what's wrong 🫢

πŸŽ€ $text

$oGdBar->{$text}

has barcode text based on $sTxt specified in new method.

heads up bestie: that's ->{$text} with the variable inside the braces β€” it's an attribute access, not a typo, and it is not a method call. don't @ me, that's just how it's written. πŸ“

πŸ‘‘ AUTHOR πŸ‘‘

Kawai Takanori GCD00051@nifty.ne.jp

thank you for your service πŸ«‘πŸ’–


The GD::Barocde::QRcode module is Copyright (c) 2003 Kawai Takanori. Japan. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

(yes, the module name is spelled GD::Barocde::QRcode right there in the copyright line β€” I said what I said, I copied it exactly, it's part of the lore πŸ’€πŸ™ˆ)


πŸ” SEE ALSO πŸ”

  • GD::Barcode

go check out the parent class, she raised this one right ✨


and that's the whole page, bestie! this one's from perl v5.40.1, dated 2025-10-27, under the title GD::Barcode::QRcode(3pm). now go make some QR codes, you absolute icon πŸ‘‘πŸ’…πŸŒΈ

πŸ“¦ where this page comes from