repo.or.cz
/
sgn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'topic/related_stock_datatables' into topic/trials_from_seedlots
[sgn.git]
/
lib
/
CXGN
/
QRcode.pm
blob
4020af34a32eb317bb7c231e9e260d700115117a
1
package
CXGN
::
QRcode
;
2
3
use
Moose
;
4
use
GD
;
5
6
use
Imager
::
QRCode
;
7
8
sub
get_barcode_file
{
9
my
$self
=
shift
;
10
my
$file
=
shift
;
11
my
$text
=
shift
;
12
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
),
21
);
22
my
$barcode
=
$qrcode
->
plot
(
$text
);
23
$barcode
->
write
(
file
=>
$file
);
24
25
return
$file
;
26
27
}
28
29
1
;