Merge branch 'topic/related_stock_datatables' into topic/trials_from_seedlots
[sgn.git] / lib / CXGN / QRcode.pm
blob4020af34a32eb317bb7c231e9e260d700115117a
1 package CXGN::QRcode;
3 use Moose;
4 use GD;
6 use Imager::QRCode;
8 sub get_barcode_file {
9 my $self = shift;
10 my $file = shift;
11 my $text = shift;
13 my $qrcode = Imager::QRCode->new(
14 size => 3,
15 margin => 5,
16 version => 1,
17 level => 'M',
18 casesensitive => 1,
19 lightcolor => Imager::Color->new(255, 255, 255),
20 darkcolor => Imager::Color->new(0, 0, 0),
22 my $barcode = $qrcode->plot($text);
23 $barcode->write(file => $file);
25 return $file;