<!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.
#
#               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 new tag.
#
#               To activate this file, rename it to ".ExifTool_config" and
#               place it in your home directory or the application script
#               directory.  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)
#
#               This sample file defines the following 11 new tags as well as a
#               number of Shortcut and Composite tags:
#
#                   1.  EXIF:NewEXIFTag
#                   2.  IPTC:NewIPTCTag
#                   3.  XMP-xxx:NewXMPxxxTag1
#                   4.  XMP-xxx:NewXMPxxxTag2
#                   5.  XMP-xxx:NewXMPxxxTag3
#                   6.  XMP-xmp:NewXMPxmpTag
#                   7.  PNG:NewPngTag1
#                   8.  PNG:NewPngTag2
#                   9.  PNG:NewPngTag3
#                  10.  MIE-Meta:NewMieTag1
#                  11.  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::Shortcuts::UserDefined = (
    MyShortcut =&gt; ['createdate','exposuretime','aperture'],
    MyAlias =&gt; 'FocalLengthIn35mmFormat',
);

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

# This is a basic example of the definition for a new XMP namespace.
# After defining this table (which may have any name), a corresponding
# "SubDirectory" entry must be added to the Main XMP table through
# the %Image::ExifTool::UserDefined definition below.</span>
%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; { },
    NewXMPxxxTag2 =&gt; { Groups =&gt; { 2 =&gt; 'Author' } },
    NewXMPxxxTag3 =&gt; { List =&gt; 'Bag' },
);

<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'># 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):</span>
    'Image::ExifTool::IPTC::ApplicationRecord' =&gt; {
        300 =&gt; {
            Name =&gt; 'NewIPTCTag',
            Format =&gt; 'string[0,16]',
        },
    },
    <span class='com'># new XMP namespaces (ie. XMP-xxx) must be added to the Main XMP table:</span>
    'Image::ExifTool::XMP::Main' =&gt; {
        xxx =&gt; {
            SubDirectory =&gt; {
                TagTable =&gt; 'Image::ExifTool::UserDefined::xxx',
            },
        },
    },
    <span class='com'># XMP tags may also be added to existing namespaces:</span>
    'Image::ExifTool::XMP::xmp' =&gt; {
        NewXMPxmpTag =&gt; { Groups =&gt; { 2 =&gt; 'Author' } },
    },
    <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; [ qw(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.  (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',
        },
        Extension =&gt; {
            Require =&gt; {
                0 =&gt; 'FileName',
            },
            ValueConv =&gt; '$val[0]=~/\.([^.]*)$/; $1',
        },
        <span class='com'># override CircleOfConfusion tag to use D/1750 instead of D/1440</span>
        CircleOfConfusion =&gt; {
            Require =&gt; {
                0 =&gt; 'ScaleFactor35efl',
            },
            ValueConv =&gt; 'sqrt(24*24+36*36) / ($val[0] * 1750)',
            PrintConv =&gt; 'sprintf("%.3f mm",$val)',
        },
    },
);

<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>