Image-ExifTool
view release on metacpan or search on metacpan
html/config.html view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head><title>example.config</title>
<link rel=stylesheet type='text/css' href='style.css' title='Style'>
</head>
<body>
<pre>
<span class=com>#------------------------------------------------------------------------------
# File: example.config --> ~/.ExifTool_config
#
# Description: Example 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 new file types and default ExifTool API options and
# command-line arguments.
#
# 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 Mac and some Windows systems this must be done
# via the command line since the GUI's may not 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
# this must be the first option on the command line):
#
# exiftool -config example.config ...
#
# This example file defines the following 16 new tags as well as
# a number of Shortcut and Composite tags:
#
# 1. EXIF:NewEXIFTag
# 2. GPS:GPSPitch
# 3. GPS:GPSRoll
# 4. IPTC:NewIPTCTag
# 5. XMP-xmp:NewXMPxmpTag
# 6. XMP-exif:GPSPitch
# 7. XMP-exif:GPSRoll
# 8. XMP-xxx:NewXMPxxxTag1
# 9. XMP-xxx:NewXMPxxxTag2
# 10. XMP-xxx:NewXMPxxxTag3
# 11. XMP-xxx:NewXMPxxxStruct
# 12. PNG:NewPngTag1
# 13. PNG:NewPngTag2
# 14. PNG:NewPngTag3
# 15. MIE-Meta:NewMieTag1
# 16. MIE-Test:NewMieTag2
#
# For detailed information on the definition of tag tables and
# tag information hashes, see lib/Image/ExifTool/README.
#------------------------------------------------------------------------------
<a name='Shortcuts'># 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.</a></span>
%Image::ExifTool::UserDefined::Shortcuts = (
MyShortcut => ['exif:createdate','exposuretime','aperture'],
MyAlias => 'FocalLengthIn35mmFormat',
);
<span class=com># NOTE: All tag names used in the following tables are case sensitive.
<a name='UserDefined'># The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.</a></span>
%Image::ExifTool::UserDefined = (
<span class=com># All EXIF tags but GPS are added to the Main table, and WriteGroup is
# used to specify where the tag is written (defaulting to ExifIFD). Note
# that when reading custom EXIF tags, the same config file must be used
# to be able to see them with the given names. Without the config file
# they may only be seen as unknown tags with the -u option.</span>
'Image::ExifTool::Exif::Main' => {
<span class=com># Example 1. EXIF:NewEXIFTag</span>
0xd000 => {
Name => 'NewEXIFTag',
Writable => 'int16u',
WriteGroup => 'IFD0',
},
<span class=com># add more user-defined EXIF tags here...</span>
},
<span class=com># the <a href="geotag.html">Geotag feature</a> writes GPSPitch and GPSRoll tags, but these
# aren't standard EXIF so we define custom tags here:</span>
'Image::ExifTool::GPS::Main' => {
<span class=com># Example 2. GPS:GPSPitch</span>
0xd000 => {
Name => 'GPSPitch',
Writable => 'rational64s',
},
<span class=com># Example 3. GPS:GPSRoll</span>
0xd001 => {
Name => 'GPSRoll',
Writable => 'rational64s',
},
},
<span class=com># IPTC tags are added to a specific record type (eg. application record):
# (Note: IPTC tag ID's are limited to the range 0-255)</span>
'Image::ExifTool::IPTC::ApplicationRecord' => {
<span class=com># Example 4. IPTC:NewIPTCTag</span>
160 => {
Name => 'NewIPTCTag',
Format => 'string[0,16]',
},
<span class=com># add more user-defined IPTC ApplicationRecord tags here...</span>
},
<span class=com># XMP tags may be added to existing namespaces:</span>
'Image::ExifTool::XMP::xmp' => {
<span class=com># Example 5. XMP-xmp:NewXMPxmpTag</span>
NewXMPxmpTag => { Groups => { 2 => 'Author' } },
<span class=com># add more user-defined XMP-xmp tags here...</span>
},
<span class=com># special Geotag tags for XMP-exif:</span>
'Image::ExifTool::XMP::exif' => {
<span class=com># Example 6. XMP-exif:GPSPitch</span>
GPSPitch => { Writable => 'rational', Groups => { 2 => 'Location' } },
<span class=com># Example 7. XMP-exif:GPSRoll</span>
GPSRoll => { Writable => 'rational', Groups => { 2 => 'Location' } },
},
<span class=com># new XMP namespaces (eg. xxx) must be added to the Main XMP table:</span>
'Image::ExifTool::XMP::Main' => {
<span class=com># namespace definition for examples 8 to 11</span>
xxx => { <span class=com># <-- must be the same as the NAMESPACE prefix</span>
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::xxx',
<span class=com># (see the definition of this table below)</span>
},
},
<span class=com># add more user-defined XMP namespaces here...</span>
},
<span class=com># new PNG tags are added to the PNG::TextualData table:</span>
'Image::ExifTool::PNG::TextualData' => {
<span class=com># Example 12. PNG:NewPngTag1</span>
NewPngTag1 => { },
<span class=com># Example 13. PNG:NewPngTag2</span>
NewPngTag2 => { iTXt => 1 }, <span class=com># (force this tag to be written as iTXt)</span>
<span class=com># Example 14. PNG:NewPngTag3</span>
NewPngTag3 => { },
},
<span class=com># add a new MIE tag (NewMieTag1) and group (MIE-Test) to MIE-Meta
# (Note: MIE group names must NOT end with a number)</span>
'Image::ExifTool::MIE::Meta' => {
<span class=com># Example 15. MIE-Meta:NewMieTag1</span>
NewMieTag1 => {
Writable => 'rational64u',
Units => [ 'cm', 'in' ],
},
<span class=com># new MIE "Test" group for example 16</span>
Test => {
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::MIETest',
DirName => 'MIE-Test',
},
},
},
<span class=com># Composite tags are added to the Composite table:</span>
'Image::ExifTool::Composite' => {
<span class=com># Composite tags have values that are derived from the values of
# other tags. The Require/Desire elements below specify constituent
# tags that must/may exist, and the keys of these hashes are used as
# indices in the @val array of the ValueConv expression to access the
# numerical (-n) values of these tags. Print-converted values are
# accessed via the @prt array. 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,
# and lib/Image/ExifTool/README for all of the details.
# The first few 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 => {
Require => 'FileName',
ValueConv => '$val=~/\.([^.]*)$/; $1',
},
<span class=com># override CircleOfConfusion tag to use D/1750 instead of D/1440</span>
CircleOfConfusion => {
Require => 'ScaleFactor35efl',
Groups => { 2 => 'Camera' },
ValueConv => 'sqrt(24*24+36*36) / ($val * 1750)',
<span class=com># an optional PrintConv may be used to format the value</span>
PrintConv => 'sprintf("%.3f mm",$val)',
},
<span class=com># generate a description for this file type</span>
FileTypeDescription => {
Require => 'FileType',
ValueConv => 'GetFileType($val,1) || $val',
},
<span class=com># calculate physical image size based on resolution</span>
PhysicalImageSize => {
Require => {
0 => 'ImageWidth',
1 => 'ImageHeight',
2 => 'XResolution',
3 => 'YResolution',
4 => 'ResolutionUnit',
},
ValueConv => '$val[0]/$val[2] . " " . $val[1]/$val[3]',
( run in 0.762 second using v1.01-cache-2.11-cpan-39bf76dae61 )