line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# mamgal - a program for creating static image galleries |
2
|
|
|
|
|
|
|
# Copyright 2009 Marcin Owsiany |
3
|
|
|
|
|
|
|
# See the README file for license information |
4
|
|
|
|
|
|
|
# A wrapper class for the Image::ExifTool library. |
5
|
|
|
|
|
|
|
package App::MaMGal::ImageInfo::ExifTool; |
6
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
42
|
|
7
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
45
|
|
8
|
2
|
|
|
2
|
|
10
|
use base 'App::MaMGal::ImageInfo::Base'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
1084
|
|
9
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
94
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
4427
|
use Image::ExifTool 'ImageInfo'; |
|
2
|
|
|
|
|
108836
|
|
|
2
|
|
|
|
|
1072
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub get_info |
14
|
|
|
|
|
|
|
{ |
15
|
109
|
|
|
109
|
0
|
217
|
my $self = shift; |
16
|
109
|
|
|
|
|
162
|
my $file = shift; |
17
|
109
|
|
|
|
|
673
|
my $tool = Image::ExifTool->new; |
18
|
109
|
|
|
|
|
45620
|
my $ret = $tool->ExtractInfo($file, [qw(Comment exif:CreateDate exif:ModifyDate exif:DateTimeOriginal)]); |
19
|
109
|
|
|
|
|
2095052
|
my $info = $tool->GetInfo; |
20
|
109
|
100
|
|
|
|
834287
|
croak $info->{Error} unless $ret; |
21
|
108
|
|
|
|
|
9544
|
return $info; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub datetime_original_string |
25
|
|
|
|
|
|
|
{ |
26
|
19
|
|
|
19
|
0
|
554
|
my $self = shift; |
27
|
19
|
|
|
|
|
83
|
$self->{info}->{DateTimeOriginal}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub datetime_digitized_string |
31
|
|
|
|
|
|
|
{ |
32
|
17
|
|
|
17
|
0
|
454
|
my $self = shift; |
33
|
17
|
|
|
|
|
59
|
$self->{info}->{CreateDate}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub datetime_string |
37
|
|
|
|
|
|
|
{ |
38
|
13
|
|
|
13
|
0
|
467
|
my $self = shift; |
39
|
13
|
|
|
|
|
49
|
$self->{info}->{ModifyDate}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub description |
43
|
|
|
|
|
|
|
{ |
44
|
6
|
|
|
6
|
0
|
489
|
my $self = shift; |
45
|
6
|
|
|
|
|
28
|
$self->{info}->{Comment}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |