1 | #------------------------------------------------------------------------------
|
---|
2 | # File: Shortcuts.pm
|
---|
3 | #
|
---|
4 | # Description: ExifTool shortcut tags
|
---|
5 | #
|
---|
6 | # Revisions: 02/07/2004 - P. Harvey Moved out of Exif.pm
|
---|
7 | # 09/15/2004 - P. Harvey Added D70Boring from Greg Troxel
|
---|
8 | # 01/11/2005 - P. Harvey Added Canon20D from Christian Koller
|
---|
9 | # 03/03/2005 - P. Harvey Added user defined shortcuts
|
---|
10 | # 03/26/2005 - P. Harvey Added Nikon from Tom Christiansen
|
---|
11 | #------------------------------------------------------------------------------
|
---|
12 |
|
---|
13 | package Image::ExifTool::Shortcuts;
|
---|
14 |
|
---|
15 | use strict;
|
---|
16 | use vars qw($VERSION);
|
---|
17 |
|
---|
18 | $VERSION = '1.41';
|
---|
19 |
|
---|
20 | # this is a special table used to define command-line shortcuts
|
---|
21 | %Image::ExifTool::Shortcuts::Main = (
|
---|
22 | # this shortcut allows the three common date/time tags to be shifted at once
|
---|
23 | AllDates => [
|
---|
24 | 'DateTimeOriginal',
|
---|
25 | 'CreateDate',
|
---|
26 | 'ModifyDate',
|
---|
27 | ],
|
---|
28 | # This is a shortcut to some common information which is useful in most images
|
---|
29 | Common => [
|
---|
30 | 'FileName',
|
---|
31 | 'FileSize',
|
---|
32 | 'Model',
|
---|
33 | 'DateTimeOriginal',
|
---|
34 | 'ImageSize',
|
---|
35 | 'Quality',
|
---|
36 | 'FocalLength',
|
---|
37 | 'ShutterSpeed',
|
---|
38 | 'Aperture',
|
---|
39 | 'ISO',
|
---|
40 | 'WhiteBalance',
|
---|
41 | 'Flash',
|
---|
42 | ],
|
---|
43 | # This shortcut provides the same information as the Canon utilities
|
---|
44 | Canon => [
|
---|
45 | 'FileName',
|
---|
46 | 'Model',
|
---|
47 | 'DateTimeOriginal',
|
---|
48 | 'ShootingMode',
|
---|
49 | 'ShutterSpeed',
|
---|
50 | 'Aperture',
|
---|
51 | 'MeteringMode',
|
---|
52 | 'ExposureCompensation',
|
---|
53 | 'ISO',
|
---|
54 | 'Lens',
|
---|
55 | 'FocalLength',
|
---|
56 | 'ImageSize',
|
---|
57 | 'Quality',
|
---|
58 | 'Flash',
|
---|
59 | 'FlashType',
|
---|
60 | 'ConditionalFEC',
|
---|
61 | 'RedEyeReduction',
|
---|
62 | 'ShutterCurtainHack',
|
---|
63 | 'WhiteBalance',
|
---|
64 | 'FocusMode',
|
---|
65 | 'Contrast',
|
---|
66 | 'Sharpness',
|
---|
67 | 'Saturation',
|
---|
68 | 'ColorTone',
|
---|
69 | 'ColorSpace',
|
---|
70 | 'LongExposureNoiseReduction',
|
---|
71 | 'FileSize',
|
---|
72 | 'FileNumber',
|
---|
73 | 'DriveMode',
|
---|
74 | 'OwnerName',
|
---|
75 | 'SerialNumber',
|
---|
76 | ],
|
---|
77 | Nikon => [
|
---|
78 | 'Model',
|
---|
79 | 'SubSecDateTimeOriginal',
|
---|
80 | 'ShutterCount',
|
---|
81 | 'LensSpec',
|
---|
82 | 'FocalLength',
|
---|
83 | 'ImageSize',
|
---|
84 | 'ShutterSpeed',
|
---|
85 | 'Aperture',
|
---|
86 | 'ISO',
|
---|
87 | 'NoiseReduction',
|
---|
88 | 'ExposureProgram',
|
---|
89 | 'ExposureCompensation',
|
---|
90 | 'WhiteBalance',
|
---|
91 | 'WhiteBalanceFineTune',
|
---|
92 | 'ShootingMode',
|
---|
93 | 'Quality',
|
---|
94 | 'MeteringMode',
|
---|
95 | 'FocusMode',
|
---|
96 | 'ImageOptimization',
|
---|
97 | 'ToneComp',
|
---|
98 | 'ColorHue',
|
---|
99 | 'ColorSpace',
|
---|
100 | 'HueAdjustment',
|
---|
101 | 'Saturation',
|
---|
102 | 'Sharpness',
|
---|
103 | 'Flash',
|
---|
104 | 'FlashMode',
|
---|
105 | 'FlashExposureComp',
|
---|
106 | ],
|
---|
107 | # This shortcut may be useful when copying tags between files to either
|
---|
108 | # copy the maker notes as a block or prevent it from being copied
|
---|
109 | MakerNotes => [
|
---|
110 | 'MakerNotes', # (for RIFF MakerNotes)
|
---|
111 | 'MakerNoteCanon',
|
---|
112 | 'MakerNoteCasio',
|
---|
113 | 'MakerNoteCasio2',
|
---|
114 | 'MakerNoteFujiFilm',
|
---|
115 | 'MakerNoteGE',
|
---|
116 | 'MakerNoteGE2',
|
---|
117 | 'MakerNoteHP',
|
---|
118 | 'MakerNoteHP2',
|
---|
119 | 'MakerNoteHP4',
|
---|
120 | 'MakerNoteHP6',
|
---|
121 | 'MakerNoteISL',
|
---|
122 | 'MakerNoteJVC',
|
---|
123 | 'MakerNoteJVCText',
|
---|
124 | 'MakerNoteKodak1a',
|
---|
125 | 'MakerNoteKodak1b',
|
---|
126 | 'MakerNoteKodak2',
|
---|
127 | 'MakerNoteKodak3',
|
---|
128 | 'MakerNoteKodak4',
|
---|
129 | 'MakerNoteKodak5',
|
---|
130 | 'MakerNoteKodak6a',
|
---|
131 | 'MakerNoteKodak6b',
|
---|
132 | 'MakerNoteKodak7',
|
---|
133 | 'MakerNoteKodak8a',
|
---|
134 | 'MakerNoteKodak8b',
|
---|
135 | 'MakerNoteKodak9',
|
---|
136 | 'MakerNoteKodak10',
|
---|
137 | 'MakerNoteKodakUnknown',
|
---|
138 | 'MakerNoteKyocera',
|
---|
139 | 'MakerNoteMinolta',
|
---|
140 | 'MakerNoteMinolta2',
|
---|
141 | 'MakerNoteMinolta3',
|
---|
142 | 'MakerNoteNikon',
|
---|
143 | 'MakerNoteNikon2',
|
---|
144 | 'MakerNoteNikon3',
|
---|
145 | 'MakerNoteOlympus',
|
---|
146 | 'MakerNoteOlympus2',
|
---|
147 | 'MakerNoteLeica',
|
---|
148 | 'MakerNoteLeica2',
|
---|
149 | 'MakerNoteLeica3',
|
---|
150 | 'MakerNoteLeica4',
|
---|
151 | 'MakerNoteLeica5',
|
---|
152 | 'MakerNoteLeica6',
|
---|
153 | 'MakerNotePanasonic',
|
---|
154 | 'MakerNotePanasonic2',
|
---|
155 | 'MakerNotePentax',
|
---|
156 | 'MakerNotePentax2',
|
---|
157 | 'MakerNotePentax3',
|
---|
158 | 'MakerNotePentax4',
|
---|
159 | 'MakerNotePentax5',
|
---|
160 | 'MakerNotePhaseOne',
|
---|
161 | 'MakerNoteReconyx',
|
---|
162 | 'MakerNoteRicoh',
|
---|
163 | 'MakerNoteRicohText',
|
---|
164 | 'MakerNoteSamsung1a',
|
---|
165 | 'MakerNoteSamsung1b',
|
---|
166 | 'MakerNoteSamsung2',
|
---|
167 | 'MakerNoteSanyo',
|
---|
168 | 'MakerNoteSanyoC4',
|
---|
169 | 'MakerNoteSanyoPatch',
|
---|
170 | 'MakerNoteSigma',
|
---|
171 | 'MakerNoteSony',
|
---|
172 | 'MakerNoteSony2',
|
---|
173 | 'MakerNoteSony3',
|
---|
174 | 'MakerNoteSony4',
|
---|
175 | 'MakerNoteSonyEricsson',
|
---|
176 | 'MakerNoteSonySRF',
|
---|
177 | 'MakerNoteUnknownText',
|
---|
178 | 'MakerNoteUnknown',
|
---|
179 | ],
|
---|
180 | # "unsafe" tags we normally don't copy in JPEG images, defined
|
---|
181 | # as a shortcut to use when rebuilding JPEG EXIF from scratch
|
---|
182 | Unsafe => [
|
---|
183 | 'IFD0:YCbCrPositioning',
|
---|
184 | 'IFD0:YCbCrCoefficients',
|
---|
185 | 'IFD0:TransferFunction',
|
---|
186 | 'ExifIFD:ComponentsConfiguration',
|
---|
187 | 'ExifIFD:CompressedBitsPerPixel',
|
---|
188 | 'InteropIFD:InteropIndex',
|
---|
189 | 'InteropIFD:InteropVersion',
|
---|
190 | 'InteropIFD:RelatedImageWidth',
|
---|
191 | 'InteropIFD:RelatedImageHeight',
|
---|
192 | ],
|
---|
193 | # common metadata tags found in IFD0 of TIFF images
|
---|
194 | CommonIFD0 => [
|
---|
195 | # standard EXIF
|
---|
196 | 'IFD0:ImageDescription',
|
---|
197 | 'IFD0:Make',
|
---|
198 | 'IFD0:Model',
|
---|
199 | 'IFD0:Software',
|
---|
200 | 'IFD0:ModifyDate',
|
---|
201 | 'IFD0:Artist',
|
---|
202 | 'IFD0:Copyright',
|
---|
203 | # other TIFF tags
|
---|
204 | 'IFD0:Rating',
|
---|
205 | 'IFD0:RatingPercent',
|
---|
206 | 'IFD0:DNGLensInfo',
|
---|
207 | 'IFD0:PanasonicTitle',
|
---|
208 | 'IFD0:PanasonicTitle2',
|
---|
209 | 'IFD0:XPTitle',
|
---|
210 | 'IFD0:XPComment',
|
---|
211 | 'IFD0:XPAuthor',
|
---|
212 | 'IFD0:XPKeywords',
|
---|
213 | 'IFD0:XPSubject',
|
---|
214 | ],
|
---|
215 | );
|
---|
216 |
|
---|
217 | #------------------------------------------------------------------------------
|
---|
218 | # load user-defined shortcuts if available
|
---|
219 | # Inputs: reference to user-defined shortcut hash
|
---|
220 | sub LoadShortcuts($)
|
---|
221 | {
|
---|
222 | my $shortcuts = shift;
|
---|
223 | my $shortcut;
|
---|
224 | foreach $shortcut (keys %$shortcuts) {
|
---|
225 | my $val = $$shortcuts{$shortcut};
|
---|
226 | # also allow simple aliases
|
---|
227 | $val = [ $val ] unless ref $val eq 'ARRAY';
|
---|
228 | # save the user-defined shortcut or alias
|
---|
229 | $Image::ExifTool::Shortcuts::Main{$shortcut} = $val;
|
---|
230 | }
|
---|
231 | }
|
---|
232 | # (for backward compatibility, renamed in ExifTool 7.75)
|
---|
233 | if (%Image::ExifTool::Shortcuts::UserDefined) {
|
---|
234 | LoadShortcuts(\%Image::ExifTool::Shortcuts::UserDefined);
|
---|
235 | }
|
---|
236 | if (%Image::ExifTool::UserDefined::Shortcuts) {
|
---|
237 | LoadShortcuts(\%Image::ExifTool::UserDefined::Shortcuts);
|
---|
238 | }
|
---|
239 |
|
---|
240 |
|
---|
241 | 1; # end
|
---|
242 |
|
---|
243 | __END__
|
---|
244 |
|
---|
245 | =head1 NAME
|
---|
246 |
|
---|
247 | Image::ExifTool::Shortcuts - ExifTool shortcut tags
|
---|
248 |
|
---|
249 | =head1 SYNOPSIS
|
---|
250 |
|
---|
251 | This module is required by Image::ExifTool.
|
---|
252 |
|
---|
253 | =head1 DESCRIPTION
|
---|
254 |
|
---|
255 | This module contains definitions for tag name shortcuts used by
|
---|
256 | Image::ExifTool. You can customize this file to add your own shortcuts.
|
---|
257 |
|
---|
258 | Individual users may also add their own shortcuts to the .ExifTool_config
|
---|
259 | file in their home directory (or the directory specified by the
|
---|
260 | EXIFTOOL_HOME environment variable). The shortcuts are defined in a hash
|
---|
261 | called %Image::ExifTool::UserDefined::Shortcuts. The keys of the hash are
|
---|
262 | the shortcut names, and the elements are either tag names or references to
|
---|
263 | lists of tag names.
|
---|
264 |
|
---|
265 | An example shortcut definition in .ExifTool_config:
|
---|
266 |
|
---|
267 | %Image::ExifTool::UserDefined::Shortcuts = (
|
---|
268 | MyShortcut => ['createdate','exif:exposuretime','aperture'],
|
---|
269 | MyAlias => 'FocalLengthIn35mmFormat',
|
---|
270 | );
|
---|
271 |
|
---|
272 | In this example, MyShortcut is a shortcut for the CreateDate,
|
---|
273 | EXIF:ExposureTime and Aperture tags, and MyAlias is a shortcut for
|
---|
274 | FocalLengthIn35mmFormat.
|
---|
275 |
|
---|
276 | =head1 AUTHOR
|
---|
277 |
|
---|
278 | Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
|
---|
279 |
|
---|
280 | This library is free software; you can redistribute it and/or modify it
|
---|
281 | under the same terms as Perl itself.
|
---|
282 |
|
---|
283 | =head1 SEE ALSO
|
---|
284 |
|
---|
285 | L<Image::ExifTool(3pm)|Image::ExifTool>
|
---|
286 |
|
---|
287 | =cut
|
---|