File: config.html

package info (click to toggle)
libimage-exiftool-perl 8.60-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 16,160 kB
  • sloc: perl: 167,865; xml: 120; makefile: 2
file content (258 lines) | stat: -rw-r--r-- 12,349 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head><title>~/.ExifTool_config</title>
<link rel=stylesheet type='text/css' href='style.css' title='Style'>
</head>
<body>
<pre>
<span class='com'>#------------------------------------------------------------------------------
# File:         ExifTool_config  --&gt;  ~/.ExifTool_config
#
# Description:  Sample user configuration file for Image::ExifTool
#
# Notes:        This example file shows how to define your own shortcuts and
#               add new EXIF, IPTC, XMP, PNG, MIE and Composite tags, as well
#               as how to specify preferred lenses for the LensID tag and
#               define default values for ExifTool options.
#
#               Note that unknown tags may be extracted even if they aren't
#               defined, but tags must be defined to be written.  Also note
#               that it is possible to override an existing tag definition
#               with a user-defined tag.
#
#               To activate this file, rename it to ".ExifTool_config" and
#               place it in your home directory or the exiftool application
#               directory.  (On Windows and Mac systems this must be done via
#               the command line since the GUI's don't allow filenames to begin
#               with a dot.  Use the "rename" command in Windows or "mv" on the
#               Mac.)  This causes ExifTool to automatically load the file when
#               run.  Your home directory is determined by the first defined of
#               the following environment variables:
#
#                   1. EXIFTOOL_HOME
#                   2. HOME
#                   3. HOMEDRIVE + HOMEPATH
#                   4. (the current directory)
#
#               Alternatively, the -config option of the exiftool application
#               may be used to load a specific configuration file (note that
#               it must be the first option on the command line):
#
#                   exiftool -config ExifTool_config ...
#
#               This sample file defines the following 12 new tags as well as a
#               number of Shortcut and Composite tags:
#
#                   1.  EXIF:NewEXIFTag
#                   2.  IPTC:NewIPTCTag
#                   3.  XMP-xmp:NewXMPxmpTag
#                   4.  XMP-xxx:NewXMPxxxTag1
#                   5.  XMP-xxx:NewXMPxxxTag2
#                   6.  XMP-xxx:NewXMPxxxTag3
#                   7.  XMP-xxx:NewXMPxxxStruct
#                   8.  PNG:NewPngTag1
#                   9.  PNG:NewPngTag2
#                  10.  PNG:NewPngTag3
#                  11.  MIE-Meta:NewMieTag1
#                  12.  MIE-Test:NewMieTag2
#
#               For detailed information on the definition of tag tables and
#               tag information hashes, see lib/Image/ExifTool/README.
#------------------------------------------------------------------------------

# Shortcut tags are used when extracting information to simplify
# commonly used commands.  They can be used to represent groups
# of tags, or to provide an alias for a tag name.</span>
%Image::ExifTool::UserDefined::Shortcuts = (
    MyShortcut =&gt; ['exif:createdate','exposuretime','aperture'],
    MyAlias =&gt; 'FocalLengthIn35mmFormat',
);

<span class='com'># NOTE: All tag names used in the following tables are case sensitive.

# The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.</span>
%Image::ExifTool::UserDefined = (
    <span class='com'># All EXIF tags are added to the Main table, and WriteGroup is used to
    # specify where the tag is written (default is ExifIFD if not specified):</span>
    'Image::ExifTool::Exif::Main' =&gt; {
        0xd000 =&gt; {
            Name =&gt; 'NewEXIFTag',
            Writable =&gt; 'int16u',
            WriteGroup =&gt; 'IFD0',
        },
    },
    <span class='com'># IPTC tags are added to a specific record type (ie. application record):
    # (Note: IPTC tags ID's are limited to the range 0-255)</span>
    'Image::ExifTool::IPTC::ApplicationRecord' =&gt; {
        240 =&gt; {
            Name =&gt; 'NewIPTCTag',
            Format =&gt; 'string[0,16]',
        },
    },
    <span class='com'># XMP tags may be added to existing namespaces:</span>
    'Image::ExifTool::XMP::xmp' =&gt; {
        NewXMPxmpTag =&gt; { Groups =&gt; { 2 =&gt; 'Author' } },
    },
    <span class='com'># new XMP namespaces (ie. xxx) must be added to the Main XMP table:</span>
    'Image::ExifTool::XMP::Main' =&gt; {
        xxx =&gt; { <span class='com'># &lt;-- must be the same as the NAMESPACE prefix</span>
            SubDirectory =&gt; {
                TagTable =&gt; 'Image::ExifTool::UserDefined::xxx',
                <span class='com'># (see the definition of this table below)</span>
            },
        },
    },
    <span class='com'># new PNG tags are added to the PNG::TextualData table:</span>
    'Image::ExifTool::PNG::TextualData' =&gt; {
        NewPngTag1 =&gt; { },
        NewPngTag2 =&gt; { },
        NewPngTag3 =&gt; { },
    },
    <span class='com'># add a new MIE tag (MieTag1) and group (MIE-Test) to MIE-Meta
    # (Note: MIE group names must NOT end with a number)</span>
    'Image::ExifTool::MIE::Meta' =&gt; {
        NewMieTag1 =&gt; {
            Writable =&gt; 'rational64u',
            Units =&gt; [ 'cm', 'in' ],
        },
        Test =&gt; {
            SubDirectory =&gt; {
                TagTable =&gt; 'Image::ExifTool::UserDefined::MIETest',
                DirName =&gt; 'MIE-Test',
            },
        },
    },
    <span class='com'># Composite tags are added to the Composite table:</span>
    'Image::ExifTool::Composite' =&gt; {
        <span class='com'># Composite tags are unique: The Require/Desire elements list tags
        # that must/may exist, and the keys of these hashes are used as
        # indices in the @val array of the ValueConv expression to derive
        # the composite tag value.  All Require'd tags must exist for the
        # Composite tag to be evaluated.  If no Require'd tags are specified,
        # then at least one of the Desire'd tags must exist.  See the
        # Composite table in Image::ExifTool::Exif for more examples.</span>
        BaseName =&gt; {
            Require =&gt; {
                0 =&gt; 'FileName',
            },
            <span class='com'># remove the extension from FileName</span>
            ValueConv =&gt; 'my $name=$val[0]; $name=~s/\..*?$//; $name',
        },
        <span class='com'># the following examples demonstrate simplifications which may be
        # used if only one tag is Require'd or Desire'd:
        # 1) the Require lookup may be replaced with a simple tag name
        # 2) "$val" may be used to represent "$val[0]" in the expression</span>
        FileExtension =&gt; {
            Require =&gt; 'FileName',
            ValueConv =&gt; '$val=~/\.([^.]*)$/; $1',
        },
        <span class='com'># override CircleOfConfusion tag to use D/1750 instead of D/1440</span>
        CircleOfConfusion =&gt; {
            Require =&gt; 'ScaleFactor35efl',
            Groups =&gt; { 2 =&gt; 'Camera' },
            ValueConv =&gt; 'sqrt(24*24+36*36) / ($val * 1750)',
            PrintConv =&gt; 'sprintf("%.3f mm",$val)',
        },
        <span class='com'># generate a description for this file type</span>
        FileTypeDescription =&gt; {
            Require =&gt; 'FileType',
            ValueConv =&gt; 'GetFileType($val,1) || $val',
        },
        <span class='com'># calculate actual image size based on resolution</span>
        ActualImageSize => {
            Require => {
                0 => 'ImageWidth',
                1 => 'ImageHeight',
                2 => 'XResolution',
                3 => 'YResolution',
                4 => 'ResolutionUnit',
            },
            ValueConv => '$val[0]/$val[2] . " " . $val[1]/$val[3]',
            PrintConv => 'sprintf("%.1fx%.1f $prt[4]", split(" ",$val))',
        },
    },
);

<a name='xmp-xxx'><span class='com'># This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'xxx', which corresponds to
# an ExifTool family 1 group name of 'XMP-xxx'.</span></a>
%Image::ExifTool::UserDefined::xxx = (
    GROUPS =&gt; { 0 =&gt; 'XMP', 1 =&gt; 'XMP-xxx', 2 =&gt; 'Image' },
    NAMESPACE =&gt; { 'xxx' =&gt; 'http://ns.myname.com/xxx/1.0/' },
    WRITABLE =&gt; 'string',
    <span class='com'># replace "NewXMPxxxTag1" with your own tag name (ie. "MyTag")</span>
    NewXMPxxxTag1 =&gt; { Writable => 'lang-alt' },
    NewXMPxxxTag2 =&gt; { Groups =&gt; { 2 =&gt; 'Author' } },
    NewXMPxxxTag3 =&gt; { List =&gt; 'Bag' },
    <span class='com'># example structured XMP tag</span>
    NewXMPxxxStruct => {
        <span class='com'># a structure with 3 fields (X, Y and Things):</span>
        Struct =&gt; {
            <span class='com'># optional namespace prefix and URI for structure fields
            # (required only if different than NAMESPACE above)</span>
            NAMESPACE =&gt; { 'test' =&gt; 'http://x.y.z/test/' },
            <span class='com'># optional structure name (used for warning messages only)</span>
            STRUCT_NAME =&gt; 'MyStruct',
            <span class='com'># optional rdf:type property for the structure</span>
            TYPE =&gt; 'http://x.y.z/test/xystruct',
            <span class='com'># structure fields (very similar to tag definitions)</span>
            X =&gt; { Writable =&gt; 'integer' },
            Y =&gt; { Writable =&gt; 'integer' },
            <span class='com'># a nested structure...</span>
            Things =&gt; {
                List =&gt; 'Bag',
                Struct =&gt; {
                    NAMESPACE =&gt; { thing =&gt; 'http://x.y.z/thing/' },
                    What  =&gt; { },
                    Where =&gt; { },
                },
            },
        },
        List =&gt; 'Seq', <span class='com'># structures may also be elements of a list</span>
    },
<span class='com'>    # Each field in the structure has an automatically-generated
    # corresponding flattened tag with an ID that is the concatenation
    # of the original structure tag ID and the field name (after
    # capitalizing the first letter of the field name if necessary).
    # The Name and/or Description of these flattened tags may be changed
    # if desired, but all other tag properties are taken from the
    # structure field definition.  When this is done, the "Flat" flag
    # must also be set in the tag definition.  For example:</span>
    NewXMPxxxStructX => { Name => 'SomeOtherName', Flat => 1 },
);

<span class='com'># Adding a new MIE group requires a few extra definitions</span>
use Image::ExifTool::MIE;
%Image::ExifTool::UserDefined::MIETest = (
    %Image::ExifTool::MIE::tableDefaults,   <span class='com'># default MIE table entries</span>
    GROUPS      =&gt; { 0 =&gt; 'MIE', 1 =&gt; 'MIE-Test', 2 =&gt; 'Document' },
    WRITE_GROUP =&gt; 'MIE-Test',
    NewMieTag2  =&gt; { },     <span class='com'># new user-defined tag in MIE-Test group</span>
);

<span class='com'># A special 'Lenses' list can be defined to give priority to specific lenses
# in the logic to determine a lens model for the Composite:LensID tag</span>
@Image::ExifTool::UserDefined::Lenses = (
    'Sigma AF 10-20mm F4-5.6 EX DC',
    'Tokina AF193-2 19-35mm f/3.5-4.5',
);

<span class='com'># Specify default ExifTool option values
# (see the <a href="ExifTool.html#Options">Options function documentation</a> for available options)</span>
%Image::ExifTool::UserDefined::Options = (
    CoordFormat =&gt; '%.6f',  <span class='com'># change default GPS coordinate format</span>
    Duplicates =&gt; 1,        <span class='com'># make -a default for the exiftool app</span>
    GeoMaxHDOP =&gt; 4,        <span class='com'># ignore GPS fixes with HDOP &gt; 4</span>
);

<span class='com'>#------------------------------------------------------------------------------</span>
1;  <span class='com'>#end</span>
</pre>
<hr>
<p class='lf'><a href="index.html">&lt;-- Back to ExifTool home page</a></p>
</body>
</html>