    #------------------------------------------------------------------------------
    # File:         ExifTool_config  -->  ~/.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 new tag.
    #
    #               To activate this file, rename it to ".ExifTool_config" and
    #               place it in your home directory or the exiftool application
    #               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 13 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:NewXMPxxxStructX
    #                   8.  XMP-xxx:NewXMPxxxStructY
    #                   9.  PNG:NewPngTag1
    #                  10.  PNG:NewPngTag2
    #                  11.  PNG:NewPngTag3
    #                  12.  MIE-Meta:NewMieTag1
    #                  13.  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.
    %Image::ExifTool::UserDefined::Shortcuts = (
        MyShortcut => ['exif:createdate','exposuretime','aperture'],
        MyAlias => 'FocalLengthIn35mmFormat',
    );

    # 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.
    %Image::ExifTool::UserDefined = (
        # 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):
        'Image::ExifTool::Exif::Main' => {
            0xd000 => {
                Name => 'NewEXIFTag',
                Writable => 'int16u',
                WriteGroup => 'IFD0',
            },
        },
        # IPTC tags are added to a specific record type (ie. application record):
        # (Note: IPTC tags ID's are limited to the range 0-255)
        'Image::ExifTool::IPTC::ApplicationRecord' => {
            240 => {
                Name => 'NewIPTCTag',
                Format => 'string[0,16]',
            },
        },
        # XMP tags may be added to existing namespaces:
        'Image::ExifTool::XMP::xmp' => {
            NewXMPxmpTag => { Groups => { 2 => 'Author' } },
        },
        # new XMP namespaces (ie. xxx) must be added to the Main XMP table:
        'Image::ExifTool::XMP::Main' => {
            xxx => {
                SubDirectory => {
                    TagTable => 'Image::ExifTool::UserDefined::xxx',
                    # (see the definition of this table below)
                },
            },
        },
        # new PNG tags are added to the PNG::TextualData table:
        'Image::ExifTool::PNG::TextualData' => {
            NewPngTag1 => { },
            NewPngTag2 => { },
            NewPngTag3 => { },
        },
        # add a new MIE tag (MieTag1) and group (MIE-Test) to MIE-Meta
        # (Note: MIE group names must NOT end with a number)
        'Image::ExifTool::MIE::Meta' => {
            NewMieTag1 => {
                Writable => 'rational64u',
                Units => [ qw(cm in) ],
            },
            Test => {
                SubDirectory => {
                    TagTable => 'Image::ExifTool::UserDefined::MIETest',
                    DirName => 'MIE-Test',
                },
            },
        },
        # Composite tags are added to the Composite table:
        'Image::ExifTool::Composite' => {
            # 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.)
            BaseName => {
                Require => {
                    0 => 'FileName',
                },
                # remove the extension from FileName
                ValueConv => 'my $name=$val[0]; $name=~s/\..*?$//; $name',
            },
            # the following examples demonstrate simplifications which may be
            # used if only one tag is Require'd or Desire'd:
            # 1) the Require/Desire lookup may be replaced with a simple tag name
            # 2) "$val" may be used to represent "$val[0]" in the expression
            Extension => {
                Require => 'FileName',
                ValueConv => '$val=~/\.([^.]*)$/; $1',
            },
            # override CircleOfConfusion tag to use D/1750 instead of D/1440
            CircleOfConfusion => {
                Require => 'ScaleFactor35efl',
                ValueConv => 'sqrt(24*24+36*36) / ($val * 1750)',
                PrintConv => 'sprintf("%.3f mm",$val)',
            },
        },
    );

    # 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'.
    %Image::ExifTool::UserDefined::xxx = (
        GROUPS => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
        NAMESPACE => { 'xxx' => 'http://ns.myname.com/xxx/1.0/' },
        WRITABLE => 'string',
        # replace "NewXMPxxxTag1" with your own tag name (ie. "MyTag")
        NewXMPxxxTag1 => { },
        NewXMPxxxTag2 => { Groups => { 2 => 'Author' } },
        NewXMPxxxTag3 => { List => 'Bag' },
        # XMP structures are defined as SubDirectory's
        NewXMPxxxStruct => {
            SubDirectory => { },
            Struct => 'MyStruct', # arbitrary name identifies entry in xmpStruct
            List => 'Seq',        # structures may also be elements of a list
        },
        # structure elements must be defined as separate tags.  The tag ID's
        # are the concatination of the structure tag ID with the ID of each
        # structure element in turn.  The list flag should be set if the
        # parent structure is contained in a list.
        NewXMPxxxStructX => { List => 1 },
        NewXMPxxxStructY => { List => 1 },
    );

    # User-defined XMP structures are added to the xmpStruct lookup
    %Image::ExifTool::UserDefined::xmpStruct = (
        # A structure with 2 elements: X and Y
        MyStruct => {
            NAMESPACE => { 'test' => 'http://x.y.z/test/' },
            # TYPE is optional -- it adds an rdf:type element to the structure
            TYPE => 'http://x.y.z/test/xystruct',
            X => { },
            Y => { },
        },
    );

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

    # 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
    @Image::ExifTool::UserDefined::Lenses = (
        'Sigma AF 10-20mm F4-5.6 EX DC',
        'Tamron 35-90mm F4 AF',
    );

    # Specify default ExifTool option values
    # (see the Options function documentation for available options)
    %Image::ExifTool::UserDefined::Options = (
        CoordFormat => '%.6f',  # change default GPS coordinate format
        Duplicates => 1,        # make -a default for the exiftool app
    );

    #------------------------------------------------------------------------------
    1;  #end

<-- Back to ExifTool home page