| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
141773
|
use v5.40; |
|
|
1
|
|
|
|
|
3
|
|
|
2
|
1
|
|
|
1
|
|
4
|
use feature 'class'; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
134
|
|
|
3
|
1
|
|
|
1
|
|
5
|
no warnings "experimental::class"; |
|
|
1
|
|
|
|
|
0
|
|
|
|
1
|
|
|
|
|
86
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
class Snig { |
|
6
|
|
|
|
|
|
|
our $VERSION = '1.001'; # VERSION |
|
7
|
|
|
|
|
|
|
# ABSTRACT: (Simple|Static|Small|S..) Image Gallery |
|
8
|
|
|
|
|
|
|
# PODNAME: Snig |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
530
|
use Log::Any qw($log); |
|
|
1
|
|
|
|
|
10617
|
|
|
|
1
|
|
|
|
|
7
|
|
|
11
|
1
|
|
|
1
|
|
4219
|
use Path::Tiny qw(path); |
|
|
1
|
|
|
|
|
16879
|
|
|
|
1
|
|
|
|
|
102
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
594
|
use Snig::Collection; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
57
|
|
|
14
|
1
|
|
|
1
|
|
566
|
use Snig::Image; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
726
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
field $name :reader :param; |
|
17
|
|
|
|
|
|
|
field $th_size :reader :param = 200; |
|
18
|
|
|
|
|
|
|
field $detail_size :reader :param = 1000; |
|
19
|
|
|
|
|
|
|
field $sort_by :reader :param = 'created'; # TODO |
|
20
|
|
|
|
|
|
|
field $input :reader :param; |
|
21
|
|
|
|
|
|
|
field $output :reader :param; |
|
22
|
|
|
|
|
|
|
field $force :reader :param; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
ADJUST { |
|
25
|
|
|
|
|
|
|
$input = path($input); |
|
26
|
|
|
|
|
|
|
$output = path($output); |
|
27
|
|
|
|
|
|
|
$output->mkdir; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$force = { map { $_ => 1 } $force->@* }; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
method run { |
|
33
|
|
|
|
|
|
|
my $collection = Snig::Collection->new(input => $input, sort_by => $sort_by, name => $name); |
|
34
|
|
|
|
|
|
|
$collection->resize_images($output, $th_size, $detail_size, $force->{resize} || 0); |
|
35
|
|
|
|
|
|
|
$collection->write_html_pages($output); |
|
36
|
|
|
|
|
|
|
$collection->write_index($output, $force->{zip} || 0); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |