line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################################### |
2
|
|
|
|
|
|
|
# A Perl package for showing/modifying JPEG (meta)data. # |
3
|
|
|
|
|
|
|
# Copyright (C) 2004,2005,2006 Stefano Bettelli # |
4
|
|
|
|
|
|
|
# See the COPYING and LICENSE files for license terms. # |
5
|
|
|
|
|
|
|
########################################################### |
6
|
15
|
|
|
15
|
|
143
|
use Image::MetaData::JPEG::data::Tables qw(:TagsAPP1_Exif :TagsAPP1_XMP); |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
3974
|
|
7
|
15
|
|
|
15
|
|
86
|
no integer; |
|
15
|
|
|
|
|
34
|
|
|
15
|
|
|
|
|
81
|
|
8
|
15
|
|
|
15
|
|
312
|
use strict; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
481
|
|
9
|
15
|
|
|
15
|
|
79
|
use warnings; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
2375
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
########################################################### |
12
|
|
|
|
|
|
|
# Entry point for dumping an APP1 segment. It decides # |
13
|
|
|
|
|
|
|
# between Exif APP1 and XMP and then dispatches to the # |
14
|
|
|
|
|
|
|
# correct subroutine (the identifier is not yet written). # |
15
|
|
|
|
|
|
|
########################################################### |
16
|
|
|
|
|
|
|
sub dump_app1 { |
17
|
163
|
|
|
163
|
0
|
352
|
my ($this) = @_; |
18
|
|
|
|
|
|
|
# Look for the 'Identifier' record (which should always exist and |
19
|
|
|
|
|
|
|
# contain the EXIF tag), and for a 'Namespace' record (Adobe XMP) |
20
|
163
|
|
|
|
|
926
|
my $identif = $this->search_record_value('Identifier'); |
21
|
163
|
|
|
|
|
664
|
my $namespace = $this->search_record_value('Namespace'); |
22
|
|
|
|
|
|
|
# If the 'Identifier' record exists and contains |
23
|
|
|
|
|
|
|
# the EXIF tag, this is a standard Exif segment |
24
|
163
|
100
|
66
|
|
|
1090
|
if ($identif && $identif eq $APP1_EXIF_TAG) { $this->dump_app1_exif(); } |
|
161
|
50
|
|
|
|
946
|
|
25
|
|
|
|
|
|
|
# Otherwise, look for a 'Namespace' record; chances |
26
|
|
|
|
|
|
|
# are this is an Adobe XMP segment |
27
|
0
|
|
|
|
|
0
|
elsif ($namespace) { return 'Dumping XMP APP1 not implemented'; } |
28
|
|
|
|
|
|
|
# Otherwise, we have a problem |
29
|
2
|
|
|
|
|
10
|
else { return 'Segment dump not possible'; } |
30
|
|
|
|
|
|
|
# return without errors |
31
|
161
|
|
|
|
|
1065
|
return undef; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
require 'Image/MetaData/JPEG/dumpers/app1_exif.pl'; |
35
|
|
|
|
|
|
|
#require 'Image/MetaData/JPEG/dumpers/app1_xmp.pl'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# successful load |
38
|
|
|
|
|
|
|
1; |