Revision 1570b866
Von Steven Schubiger vor mehr als 2 Jahren hinzugefügt
SL/Helper/QrBill.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use warnings; |
5 | 5 |
|
6 |
use File::Spec (); |
|
6 | 7 |
use Imager (); |
7 | 8 |
use Imager::QRCode (); |
8 | 9 |
|
9 | 10 |
my %Config = ( |
10 |
cross_file => 'image/CH-Kreuz_7mm.png', |
|
11 |
img_dir => 'image', |
|
12 |
cross_file => 'CH-Kreuz_7mm.png', |
|
11 | 13 |
out_file => 'out.png', |
12 | 14 |
); |
13 | 15 |
|
... | ... | |
210 | 212 |
my $self = shift; |
211 | 213 |
|
212 | 214 |
my $cross = Imager->new(); |
213 |
$cross->read(file => $Config{cross_file}) or die $cross->errstr, "\n";
|
|
215 |
$cross->read(file => File::Spec->catfile(@Config{qw(img_dir cross_file)})) or die $cross->errstr, "\n";
|
|
214 | 216 |
|
215 | 217 |
return $cross->scale(xpixels => 35, ypixels => 35, qtype => 'mixing'); |
216 | 218 |
} |
Auch abrufbar als: Unified diff
Swiss QR-Bill: QrBill.pm: Verwende portable Dateipfade