[TriLUG] online QR code generator
Wes Garrison via TriLUG
trilug at trilug.org
Thu Oct 5 16:18:55 EDT 2017
Feel free to use in whole or in part.
-Wes
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw(:standard);
if (param('qrcommand') ne "") {
use Imager::QRCode;
use MIME::Base64 qw(encode_base64);
my $encodeStmt = 'qrcommand=' . param('qrcommand') . ',data=' .
param('data');
my $qrcode = Imager::QRCode->new(
size => 8,
margin => 2,
version => 0,
level => 'M',
#mode => 'alpha-numerical',
casesensitive => 1,
lightcolor => Imager::Color->new(255, 255, 255),
darkcolor => Imager::Color->new(0, 0, 0)
);
my $img = $qrcode->plot($encodeStmt);
my $qrData;
$img->write(data => \$qrData, type => 'gif') || warn $img->errstr;
my $base64qrcode = encode_base64($qrData);
print "Content-type: text/html\n\n";
print "
<html>
<head></head>
<body>
<img src='data:image/gif;base64,$base64qrcode' title='$encodeStmt'
alt='$encodeStmt'>
</body>
</html>
";
}
else {
print "Content-type: text/html\n\n";
print "Please provide a value to encode";
}
_________________________________
Wesley S. Garrison
Network Engineer
Xitech Communications, Inc.
phone: (919) 260-0803
fax: (919) 932-5051
__________________________________
"Lead us not into temptation, but deliver us from email."
On Thu, Oct 5, 2017 at 4:10 PM, Warren Myers via TriLUG <trilug at trilug.org>
wrote:
> I use https://www.the-qrcode-generator.com (have it as an App in Chrome)
>
> On Thu, Oct 5, 2017 at 1:54 PM, Mauricio Tavares via TriLUG <
> trilug at trilug.org> wrote:
>
> > Which one would you recommend?
> > --
> > This message was sent to: Warren <volcimaster at gmail.com>
> > To unsubscribe, send a blank message to trilug-leave at trilug.org from
> that
> > address.
> > TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> > Unsubscribe or edit options on the web : https://www.trilug.org/
> > mailman/options/trilug/volcimaster%40gmail.com
> > Welcome to TriLUG: http://trilug.org/welcome
>
>
>
>
> --
> *Warren Myers*
> http://antipaucity.com
> http://twitter.com/warrenmyers
> http://www.linkedin.com/in/warrenmyers
> https://www.digitalocean.com/?refcode=d197a961987a
> TXT WMYERS to 50500 | http://contxts.com
> --
> This message was sent to: Wes <wes at xitechusa.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web : https://www.trilug.org/
> mailman/options/trilug/wes%40xitechusa.com
> Welcome to TriLUG: http://trilug.org/welcome
>
More information about the TriLUG
mailing list