brapi refactor error response
[sgn.git] / lib / CXGN / QRcode.pm
blobb8861d1cef147b6cb560e7c9f7b7cdea9c444738
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 => 5,
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;