File Coverage

blib/lib/Image/ExifTool/Shortcuts.pm
Criterion Covered Total %
statement 6 12 50.0
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod 0 1 0.0
total 8 18 44.4


line stmt bran cond sub pod time code
1             #------------------------------------------------------------------------------
2             # File: Shortcuts.pm
3             #
4             # Description: ExifTool shortcut tags
5             #
6             # Revisions: 02/07/2004 - PH Moved out of Exif.pm
7             # 09/15/2004 - PH Added D70Boring from Greg Troxel
8             # 01/11/2005 - PH Added Canon20D from Christian Koller
9             # 03/03/2005 - PH Added user defined shortcuts
10             # 03/26/2005 - PH Added Nikon from Tom Christiansen
11             # 02/28/2007 - PH Removed model-dependent shortcuts
12             # --> this is what UserDefined::Shortcuts is for
13             # 02/25/2009 - PH Added Unsafe
14             # 07/03/2010 - PH Added CommonIFD0
15             #------------------------------------------------------------------------------
16              
17             package Image::ExifTool::Shortcuts;
18              
19 50     50   395 use strict;
  50         121  
  50         1951  
20 50     50   330 use vars qw($VERSION);
  50         383  
  50         26036  
21              
22             $VERSION = '1.67';
23              
24             # this is a special table used to define command-line shortcuts
25             # (documentation Notes may be added for these via %shortcutNotes in BuildTagLookup.pm)
26             %Image::ExifTool::Shortcuts::Main = (
27             # this shortcut allows the three common date/time tags to be shifted at once
28             AllDates => [
29             'DateTimeOriginal',
30             'CreateDate',
31             'ModifyDate',
32             ],
33             # This is a shortcut to some common information which is useful in most images
34             Common => [
35             'FileName',
36             'FileSize',
37             'Model',
38             'DateTimeOriginal',
39             'ImageSize',
40             'Quality',
41             'FocalLength',
42             'ShutterSpeed',
43             'Aperture',
44             'ISO',
45             'WhiteBalance',
46             'Flash',
47             ],
48             # This shortcut provides the same information as the Canon utilities
49             Canon => [
50             'FileName',
51             'Model',
52             'DateTimeOriginal',
53             'ShootingMode',
54             'ShutterSpeed',
55             'Aperture',
56             'MeteringMode',
57             'ExposureCompensation',
58             'ISO',
59             'Lens',
60             'FocalLength',
61             'ImageSize',
62             'Quality',
63             'Flash',
64             'FlashType',
65             'ConditionalFEC',
66             'RedEyeReduction',
67             'ShutterCurtainHack',
68             'WhiteBalance',
69             'FocusMode',
70             'Contrast',
71             'Sharpness',
72             'Saturation',
73             'ColorTone',
74             'ColorSpace',
75             'LongExposureNoiseReduction',
76             'FileSize',
77             'FileNumber',
78             'DriveMode',
79             'OwnerName',
80             'SerialNumber',
81             ],
82             Nikon => [
83             'Model',
84             'SubSecDateTimeOriginal',
85             'ShutterCount',
86             'LensSpec',
87             'FocalLength',
88             'ImageSize',
89             'ShutterSpeed',
90             'Aperture',
91             'ISO',
92             'NoiseReduction',
93             'ExposureProgram',
94             'ExposureCompensation',
95             'WhiteBalance',
96             'WhiteBalanceFineTune',
97             'ShootingMode',
98             'Quality',
99             'MeteringMode',
100             'FocusMode',
101             'ImageOptimization',
102             'ToneComp',
103             'ColorHue',
104             'ColorSpace',
105             'HueAdjustment',
106             'Saturation',
107             'Sharpness',
108             'Flash',
109             'FlashMode',
110             'FlashExposureComp',
111             ],
112             # This shortcut may be useful when copying tags between files to either
113             # copy the maker notes as a block or prevent it from being copied
114             MakerNotes => [
115             'MakerNotes', # (for RIFF MakerNotes)
116             'MakerNoteApple',
117             'MakerNoteCanon',
118             'MakerNoteCasio',
119             'MakerNoteCasio2',
120             'MakerNoteDJI',
121             'MakerNoteDJIInfo',
122             'MakerNoteFLIR',
123             'MakerNoteFujiFilm',
124             'MakerNoteGE',
125             'MakerNoteGE2',
126             'MakerNoteHasselblad',
127             'MakerNoteHP',
128             'MakerNoteHP2',
129             'MakerNoteHP4',
130             'MakerNoteHP6',
131             'MakerNoteISL',
132             'MakerNoteJVC',
133             'MakerNoteJVCText',
134             'MakerNoteKodak1a',
135             'MakerNoteKodak1b',
136             'MakerNoteKodak2',
137             'MakerNoteKodak3',
138             'MakerNoteKodak4',
139             'MakerNoteKodak5',
140             'MakerNoteKodak6a',
141             'MakerNoteKodak6b',
142             'MakerNoteKodak7',
143             'MakerNoteKodak8a',
144             'MakerNoteKodak8b',
145             'MakerNoteKodak8c',
146             'MakerNoteKodak9',
147             'MakerNoteKodak10',
148             'MakerNoteKodak11',
149             'MakerNoteKodak12',
150             'MakerNoteKodakUnknown',
151             'MakerNoteKyocera',
152             'MakerNoteMinolta',
153             'MakerNoteMinolta2',
154             'MakerNoteMinolta3',
155             'MakerNoteMotorola',
156             'MakerNoteNikon',
157             'MakerNoteNikon2',
158             'MakerNoteNikon3',
159             'MakerNoteNintendo',
160             'MakerNoteOlympus',
161             'MakerNoteOlympus2',
162             'MakerNoteOlympus3',
163             'MakerNoteLeica',
164             'MakerNoteLeica2',
165             'MakerNoteLeica3',
166             'MakerNoteLeica4',
167             'MakerNoteLeica5',
168             'MakerNoteLeica6',
169             'MakerNoteLeica7',
170             'MakerNoteLeica8',
171             'MakerNoteLeica9',
172             'MakerNoteLeica10',
173             'MakerNotePanasonic',
174             'MakerNotePanasonic2',
175             'MakerNotePanasonic3',
176             'MakerNotePentax',
177             'MakerNotePentax2',
178             'MakerNotePentax3',
179             'MakerNotePentax4',
180             'MakerNotePentax5',
181             'MakerNotePentax6',
182             'MakerNotePhaseOne',
183             'MakerNoteReconyx',
184             'MakerNoteReconyx2',
185             'MakerNoteReconyx3',
186             'MakerNoteRicoh',
187             'MakerNoteRicoh2',
188             'MakerNoteRicohPentax',
189             'MakerNoteRicohText',
190             'MakerNoteSamsung1a',
191             'MakerNoteSamsung1b',
192             'MakerNoteSamsung2',
193             'MakerNoteSanyo',
194             'MakerNoteSanyoC4',
195             'MakerNoteSanyoPatch',
196             'MakerNoteSigma',
197             'MakerNoteSony',
198             'MakerNoteSony2',
199             'MakerNoteSony3',
200             'MakerNoteSony4',
201             'MakerNoteSony5',
202             'MakerNoteSonyEricsson',
203             'MakerNoteSonySRF',
204             'MakerNoteUnknownText',
205             'MakerNoteUnknownBinary',
206             'MakerNoteUnknown',
207             ],
208             # "unsafe" tags we normally don't copy in JPEG images, defined
209             # as a shortcut to use when rebuilding JPEG EXIF from scratch
210             Unsafe => [
211             'IFD0:YCbCrPositioning',
212             'IFD0:YCbCrCoefficients',
213             'IFD0:TransferFunction',
214             'ExifIFD:ComponentsConfiguration',
215             'ExifIFD:CompressedBitsPerPixel',
216             'InteropIFD:InteropIndex',
217             'InteropIFD:InteropVersion',
218             'InteropIFD:RelatedImageWidth',
219             'InteropIFD:RelatedImageHeight',
220             ],
221             # standard tags used to define the color space of an image
222             # (useful to preserve color space when deleting all meta information)
223             ColorSpaceTags => [
224             'ExifIFD:ColorSpace',
225             'ExifIFD:Gamma',
226             'InteropIFD:InteropIndex',
227             'ICC_Profile',
228             ],
229             # common metadata tags found in IFD0 of TIFF images
230             CommonIFD0 => [
231             # standard EXIF
232             'IFD0:ImageDescription',
233             'IFD0:Make',
234             'IFD0:Model',
235             'IFD0:Software',
236             'IFD0:ModifyDate',
237             'IFD0:Artist',
238             'IFD0:Copyright',
239             # other TIFF tags
240             'IFD0:Rating',
241             'IFD0:RatingPercent',
242             'IFD0:DNGLensInfo',
243             'IFD0:PanasonicTitle',
244             'IFD0:PanasonicTitle2',
245             'IFD0:XPTitle',
246             'IFD0:XPComment',
247             'IFD0:XPAuthor',
248             'IFD0:XPKeywords',
249             'IFD0:XPSubject',
250             ],
251             # large binary data tags which won't be loaded if excluded when extracting
252             LargeTags => [
253             'CanonVRD',
254             'DLOData',
255             'EXIF',
256             'ICC_Profile',
257             'IDCPreviewImage',
258             'ImageData',
259             'IPTC',
260             'JpgFromRaw',
261             'OriginalRawImage',
262             'OtherImage',
263             'PreviewImage',
264             'ThumbnailImage',
265             'TIFFPreview',
266             'XML',
267             'XMP',
268             'ZoomedPreviewImage',
269             ],
270             'ls-l' => [
271             'FilePermissions',
272             'FileHardLinks',
273             'FileUserID',
274             'FileGroupID',
275             'FileSize#',
276             'FileModifyDate',
277             'FileName',
278             ],
279             );
280              
281             #------------------------------------------------------------------------------
282             # load user-defined shortcuts if available
283             # Inputs: reference to user-defined shortcut hash
284             sub LoadShortcuts($)
285             {
286 0     0 0   my $shortcuts = shift;
287 0           my $shortcut;
288 0           foreach $shortcut (keys %$shortcuts) {
289 0           my $val = $$shortcuts{$shortcut};
290             # also allow simple aliases
291 0 0         $val = [ $val ] unless ref $val eq 'ARRAY';
292             # save the user-defined shortcut or alias
293 0           $Image::ExifTool::Shortcuts::Main{$shortcut} = $val;
294             }
295             }
296             # (for backward compatibility, renamed in ExifTool 7.75)
297             if (%Image::ExifTool::Shortcuts::UserDefined) {
298             LoadShortcuts(\%Image::ExifTool::Shortcuts::UserDefined);
299             }
300             if (%Image::ExifTool::UserDefined::Shortcuts) {
301             LoadShortcuts(\%Image::ExifTool::UserDefined::Shortcuts);
302             }
303              
304              
305             1; # end
306              
307             __END__