line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::ExifTool; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
56807
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
73
|
|
4
|
2
|
|
|
2
|
|
12
|
use base qw(Template::Plugin); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1599
|
|
5
|
2
|
|
|
2
|
|
5451
|
use vars qw($VERSION $AUTOLOAD); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
101
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
8
|
use Template::Plugin; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
37
|
|
9
|
2
|
|
|
2
|
|
4316
|
use Image::ExifTool; |
|
2
|
|
|
|
|
106184
|
|
|
2
|
|
|
|
|
787
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
4
|
|
|
4
|
1
|
75019
|
my ($class, $context, $file, @params) = @_; |
13
|
4
|
100
|
|
|
|
33
|
return $class->error("file is not specified") unless $file; |
14
|
3
|
100
|
|
|
|
78
|
return $class->error("$file: No such file") unless -e $file; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
19
|
my $exiftool = Image::ExifTool->new; |
17
|
2
|
|
|
|
|
39800
|
my $info = $exiftool->ImageInfo($file, @params); |
18
|
2
|
|
|
|
|
27277
|
bless { |
19
|
|
|
|
|
|
|
_CONTEXT => $context, |
20
|
|
|
|
|
|
|
_exiftool => $exiftool, |
21
|
|
|
|
|
|
|
_info => $info, |
22
|
|
|
|
|
|
|
}, $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
1
|
80
|
sub info { shift->{_info} } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub AUTOLOAD { |
28
|
1
|
|
|
1
|
|
71
|
my $self = shift; |
29
|
1
|
|
|
|
|
7
|
(my $meth = $AUTOLOAD) =~ s/.*:://; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
22
|
if (exists $self->{_info}->{$meth}) { |
|
|
50
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
return $self->{_info}->{$meth} ; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
elsif ($self->{_exiftool}->can($meth)) { |
35
|
1
|
|
|
|
|
5
|
return $self->{_exiftool}->$meth(@_); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
else { |
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |