line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Lazy::Image; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1092
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use CGI::Lazy::Globals; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
342
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------- |
8
|
|
|
|
|
|
|
sub dir { |
9
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
0
|
return $self->{_dir}; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
sub file { |
16
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
17
|
0
|
|
|
|
|
0
|
my $file = shift; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
my $dir = $self->dir; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
return "$dir/$file"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------- |
25
|
|
|
|
|
|
|
sub load { |
26
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
27
|
0
|
|
|
|
|
0
|
my $file = shift; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
0
|
my $dir = $self->dir; |
30
|
0
|
|
|
|
|
0
|
$dir =~s/^\///; #strip a leading slash |
31
|
0
|
|
|
|
|
0
|
my $docroot = $ENV{DOCUMENT_ROOT}; |
32
|
0
|
|
|
|
|
0
|
$docroot =~ s/\/$//; #strip the trailing slash so we don't double it |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
return "$docroot/$dir/$file"; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------- |
39
|
|
|
|
|
|
|
sub new { |
40
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
41
|
1
|
|
|
|
|
3
|
my $q = shift; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
5
|
return bless { |
44
|
|
|
|
|
|
|
_q => $q, |
45
|
|
|
|
|
|
|
_dir => $q->config->imgDir, |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
}, $class; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------------- |
51
|
|
|
|
|
|
|
sub q { |
52
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
return $self->{_q}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |