~/.ExifTool_config

    #------------------------------------------------------------------------------
    # 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 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 9 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
    #
    #               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::Shortcuts::UserDefined = (
        MyShortcut => ['createdate','exposuretime','aperture'],
        MyAlias => 'FocalLengthIn35mmFormat',
    );

    # 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.
    %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' },
    );

    # 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):
        'Image::ExifTool::IPTC::ApplicationRecord' => {
            300 => {
                Name => 'NewIPTCTag',
                Format => 'string[0,16]',
            },
        },
        # new XMP namespaces (ie. XMP-xxx) must be added to the Main XMP table:
        'Image::ExifTool::XMP::Main' => {
            xxx => {
                SubDirectory => {
                    TagTable => 'Image::ExifTool::UserDefined::xxx',
                },
            },
        },
        # XMP tags may also be added to existing namespaces:
        'Image::ExifTool::XMP::xmp' => {
            NewXMPxmpTag => { Groups => { 2 => 'Author' } },
        },
        # new PNG tags are added to the PNG::TextualData table:
        'Image::ExifTool::PNG::TextualData' => {
            NewPngTag1 => { },
            NewPngTag2 => { },
            NewPngTag3 => { },
        },
        # 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',
            },
            Extension => {
                Require => {
                    0 => 'FileName',
                },
                ValueConv => '$val[0]=~/\.([^.]*)$/; $1',
            },
            # override CircleOfConfusion tag to use D/1750 instead of D/1440
            CircleOfConfusion => {
                Require => {
                    0 => 'ScaleFactor35efl',
                },
                ValueConv => 'sqrt(24*24+36*36) / ($val[0] * 1750)',
                PrintConv => 'sprintf("%.3f mm",$val)',
            },
            # get latitude/logitude reference from XMP lat/long tags
            # (used to set EXIF GPS position from XMP tags)
            GPSLatitudeRef => {
                Require => {
                    0 => 'XMP:GPSLatitude',
                },
                ValueConv => '$val[0] < 0 ? "S" : "N"',
                PrintConv => {
                    N => 'North',
                    S => 'South',
                },
            },
            GPSLongitudeRef => {
                Require => {
                    0 => 'XMP:GPSLongitude',
                },
                ValueConv => '$val[0] < 0 ? "W" : "E"',
                PrintConv => {
                    E => 'East',
                    W => 'West',
                },
            },
        },
    );

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

<-- Back to ExifTool home page