summaryrefslogtreecommitdiff
path: root/test.pl
blob: 45619f024cd6c2c27fdad1b65560e7f7b75d1ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl 
use strict;
use warnings;
use Data::QRCode;
use Imager::QRCode::Fancy;
use Imager;
 
my $string = 'simple test string, but a bit long just in case we get a too-small QR code';
my $data = Data::QRCode->new(
    input_data => $string,
    error_correction_level => 'H',
);
 
my $src_img = Imager->new(
    file=>'/tmp/faccione.png',
)->scale(scalefactor=>2,qtype=>'mixing');
 
my $img = Imager::QRCode::Fancy::make({
    qr_code => $data,
    image => $src_img,
});
$img->write(file=>'/tmp/qr2.png');