man Image::ExifTool () - Read and write meta information in images

NAME

Image::ExifTool - Read and write meta information in images

SYNOPSIS

  use Image::ExifTool 'ImageInfo';

  # ---- Simple procedural usage ----

  # Get hash of meta information tag names/values from an image
  $info = ImageInfo('a.jpg');

  # ---- Object-oriented usage ----

  # Create a new Image::ExifTool object
  $exifTool = new Image::ExifTool;

  # Extract meta information from an image
  $exifTool->ExtractInfo($file, \%options);

  # Get list of tags in the order they were found in the file
  @tagList = $exifTool->GetFoundTags('File');

  # Get the value of a specified tag
  $value = $exifTool->GetValue($tag, $type);

  # Get a tag description
  $description = $exifTool->GetDescription($tag);

  # Get the group name associated with this tag
  $group = $exifTool->GetGroup($tag, $family);

  # Set a new value for a tag
  $exifTool->SetNewValue($tag, $newValue);

  # Write new meta information to a file
  $success = $exifTool->WriteInfo($srcfile, $dstfile);

  # ...plus a host of other useful methods...

DESCRIPTION

ExifTool provides an extensible set of perl modules to read and write meta information in image files. It reads EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB and ID3 meta information from JPEG, JP2, TIFF, GIF, BMP, PGM, PGM, PBM, PNG, MNG, JNG, MIFF, PICT, EPS, PS, AI, PDF, PSD, THM, CRW (Canon RAW), CR2 (Canon RAW 2), MRW (Minolta RAW), NEF (Nikon Electronic image Format), PEF (Pentax RAW), ORF (Olympus RAW Format), RAF (FujiFilm RAW Format), SRF (Sony Raw Format), MOS (Leaf Mosaic) and DNG (Digital Negative) images, MP3 and WAV audio files, and MOV videos. ExifTool also extracts information from the maker notes of many digital cameras by various manufacturers including Canon, Casio, FujiFilm, Kodak, Minolta/Konica-Minolta, Nikon, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo and Sigma/Foveon. It writes EXIF, GPS, IPTC, XMP and MakerNotes information to JPEG, TIFF, GIF, PPM, PGM, PBM, PNG, MNG, JNG, CRW, THM, CR2, MRW, NEF, PEF, MOS and DNG files.

METHODS

new

Creates a new ExifTool object.

    $exifTool = new Image::ExifTool;

Note that ExifTool uses AUTOLOAD to load non-member methods, so any class using Image::ExifTool as a base class must define an AUTOLOAD which calls Image::ExifTool::DoAutoLoad(). ie)

    sub AUTOLOAD
    {
        Image::ExifTool::DoAutoLoad($AUTOLOAD, @_);
    }

ImageInfo

Obtain meta information from image. This is the one step function for obtaining meta information from an image. Internally, ImageInfo calls ExtractInfo to extract the information, GetInfo to generate the information hash, and GetTagList for the returned tag list.

    # Return meta information for 2 tags only (procedural)
    $info = ImageInfo($filename, $tag1, $tag2)

    # Return information about an open image file (object-oriented)
    $info = $exifTool->ImageInfo(\*FILE)

    # Return information from image data in memory for specified tags
    $info = ImageInfo(\$imageData, \@tagList, \%options)

    # Extract information from an embedded thumbnail image
    $info = ImageInfo('image.jpg', 'thumbnailimage');
    $thumbInfo = ImageInfo($$info{ThumbnailImage});
Inputs:
ImageInfo is very flexible about the input arguments, and interprets them based on their type. It may be called with one or more arguments. The one required argument is either a SCALAR (the image file name), a file reference (a reference to the image file) or a SCALAR reference (a reference to the image in memory). Other arguments are optional. The order of the arguments is not significant, except that the first SCALAR is taken to be the file name unless a file reference or scalar reference came earlier in the argument list. Below is an explanation of how the ImageInfo function arguments are interpreted:
ExifTool ref
ImageInfo may be called with an ExifTool object if desired. The advantage of using the object-oriented form is that the options may be set before calling ImageInfo, and the object may be used afterward to access member functions.
SCALAR
The first scalar argument is taken to be the file name unless an earlier argument specified the image data via a file reference (file ref) or data reference (SCALAR ref). The remaining scalar arguments are names of tags for requested information. If no tags are specified, all possible information is extracted. Tag names may begin with '-' indicating tags to exclude. The tag names are case-insensitive, so note that the returned tags may not be exactly the same as the requested tags. For this reason it is best to use either the keys of the returned hash or the elements of the tag array when accessing the return values. See Image::ExifTool::TagNames for a complete list of ExifTool tag names.
File ref
A reference to an open image file. If you use this method (or a SCALAR reference) to access information in an image, the FileName and Directory tags will not be returned. (Also, the FileSize and FileModifyDate tags will not be returned unless it is a plain file.)
SCALAR ref
A reference to image data in memory.
ARRAY ref
Reference to a list of tag names. On entry, any elements in the list are added to the list of requested tags. Tags with names beginning with '-' are excluded. On return, this list is updated to contain a sorted list of tag names in the proper case.
HASH ref
Reference to a hash containing the options settings. See Options documentation below for a list of available options. Options specified as arguments to ImageInfo take precedence over Options settings.
Return Values:
ImageInfo returns a reference to a hash of tag/value pairs. The keys of the hash are the tag identifiers, which are similar to the tag names but my have an embedded copy number if more than one tag with that name was found in the image. Use GetTagName to remove the copy number from the tag. Note that the case of the tags may not be the same as requested. Here is a simple example to print out the information returned by ImageInfo:
    foreach (sort keys %$info) {
        print "$_ => $$info{$_}\n";
    }
Values of the returned hash are usually simple scalars, but a scalar reference is used to indicate binary data and an array reference may be used to indicate a list. Lists of values are joined by commas into a single string if and only if the PrintConv option is enabled and the List option is disabled (which are the defaults). Note that binary values are not necessarily extracted unless specifically requested or the Binary option is set. If not extracted the value is a reference to a string of the form Binary data ##### bytes. The code below gives an example of how to handle these return values, as well as illustrating the use of other ExifTool functions:
    use Image::ExifTool;
    my $exifTool = new Image::ExifTool;
    $exifTool->Options(Unknown => 1);
    my $info = $exifTool->ImageInfo('a.jpg');
    my $group = '';
    my $tag;
    foreach $tag ($exifTool->GetFoundTags('Group0')) {
        if ($group ne $exifTool->GetGroup($tag)) {
            $group = $exifTool->GetGroup($tag);
            print "---- $group ----\n";
        }
        my $val = $info->{$tag};
        if (ref $val eq 'SCALAR') {
            if ($$val =~ /^Binary data/) {
                $val = "($$val)";
            } else {
                my $len = length($$val);
                $val = "(Binary data $len bytes)";
            }
        }
        printf("%-32s : %s\n", $exifTool->GetDescription($tag), $val);
    }
As well as tags representing information extracted from the image, the following tags generated by ExifTool may be returned:
    ExifToolVersion - The ExifTool version number.
    Error - An error message if the image could not be read.
    Warning - A warning message if problems were encountered
              while extracting information from the image.

Options

Get/set ExifTool options. This function can be called to set the default options for an ExifTool object. Options set this way are in effect for all function calls but may be overridden by options passed as arguments to a specific function.

    # Exclude the 'OwnerName' tag from returned information
    $exifTool->Options(Exclude => 'OwnerName');

    # Only get information in EXIF or MakerNotes groups
    $exifTool->Options(Group0 => ['EXIF', 'MakerNotes']);

    # Ignore information from IFD1
    $exifTool->Options(Group1 => '-IFD1');

    # Sort by groups in family 2, and extract unknown tags
    $exifTool->Options(Sort => 'Group2', Unknown => 1);

    # Do not extract duplicate tag names
    $oldSetting = $exifTool->Options(Duplicates => 0);

    # Get current setting
    $isVerbose = $exifTool->Options('Verbose');
Inputs:
0) ExifTool object reference. 1) Option parameter name. 2) [optional] Option parameter value. 3-N) [optional] Additional parameter/value pairs.
Option Parameters:
Binary
Flag to extract the value data for all binary tags. Tag values representing large binary data blocks (ie. ThumbnailImage) are not necessarily extracted unless this option is set or the tag is specifically requested by name. Default is 0.
ByteOrder
The byte order for newly created EXIF segments when writing. If EXIF information already exists, the existing order is used instead. Valid values are 'MM', 'II' and undef. If not defined, the order of the maker notes is used (if maker notes are copied), otherwise 'MM' is used. Default is undef.
Charset
Character set for converting Unicode character strings. Valid values are:
  UTF8  - UTF-8 characters (the default)
  Latin - Windows Latin1 (cp1252)
Compact
Write compact output. Default is 0. Some data formats (XMP, IPTC) specify that the data be padded with blanks to allow in-place editing. By setting this flag, 2kB is saved for files with XMP data, and 100 bytes for IPTC.
Composite
Flag to calculate Composite tags automatically. Default is 1.
CoordFormat
Format for printing GPS coordinates. This is a printf format string with specifiers for degrees, minutes and seconds in that order, however minutes and seconds may be omitted. For example, the following table gives the output for the same coordinate using various formats:
        CoordFormat              Output
    -------------------    ------------------
    q{%d deg %d' %.2f"}    54 deg 59' 22.80"   (the default)
    q{%d deg %.4f min}     54 deg 59.3800 min
    q{%.6f degrees}        54.989667 degrees
DateFormat
Format for printing EXIF date/time. See CWstrftime in the POSIX package for details about the format string. The default format is equivalent to %Y:%m:%d CW%H:%M:%S.
Duplicates
Flag to preserve values of duplicate tags (instead of overwriting existing value). Default is 1.
Exclude
Exclude specified tags from tags extracted from an image. The option value is either a tag name or reference to a list of tag names to exclude. The case of tag names is not significant. This option is ignored for specifically requested tags. Tags may also be excluded by preceeding their name with a '-' in the arguments to ImageInfo.
IgnoreMinorErrors
Causes minor errors to be downgraded to warnings, and minor warnings to be ignored. This option is provided mainly to allow writing of files when minor errors occur, but also allows thumbnail and preview images to be extracted even if they don't have a recognizable header. Minor errors/warnings are denoted by '[minor]' at the start of the message.
Group#
Extract tags only for specified groups in family # (Group0 assumed if # not given). The option value may be a single group name or a reference to a list of groups. Case is significant in group names. Specify a group to be excluded by preceeding group name with a '-'. See GetAllGroups for a list of available groups.
List
Flag to extract lists of PrintConv values into arrays instead of concatinating them into comma-separated strings. Default is 0.
MakerNotes
Flag to cause MakerNotes data and other writable subdirectories (such as PrintIM) to be extracted as a data block.
PrintConv
Flag to enable automatic print conversion. Also enables inverse print conversion for writing. Default is 1.
Sort
Specifies order to sort tags in returned list:
  Alpha  - Sort alphabetically
  File   - Sort in order that tags were found in the file
  Group# - Sort by tag group, where # is the group family
           number.  If # is not specified, Group0 is assumed.
           See GetGroup for a list of groups.
  Input  - Sort in same order as input tag arguments (default)
Unknown
Flag to get the values of unknown tags. If set to 1, unknown tags are extracted from EXIF directories. If set to 2, unknown tags are also extracted from binary data blocks. Default is 0.
Verbose
Flag to print verbose messages. May be set to a value from 0 to 5 to be increasingly verbose. Default is 0. With the verbose option set, messages are printed to the console as the file is parsed. Level 1 prints the tag names and raw values. Level 2 adds more details about the tags. Level 3 adds a hex dump of the tag data, but with limits on the number of bytes dumped. Levels 4 and 5 remove the dump limit on tag values and JPEG segment data respectively.
Return Values:
The original value of the last specified parameter.

ClearOptions

Reset all options to their default values.

    $exifTool->ClearOptions();
Inputs:
0) ExifTool object reference
Return Values:
(none)

ExtractInfo

Extract all meta information from an image.

    $success = $exifTool->ExtractInfo('image.jpg', \%options);
Inputs:
ExtractInfo takes exactly the same arguments as ImageInfo. The only difference is that a list of tags is not returned if an ARRAY reference is given. The following options are effective in the call to ExtractInfo: Binary, Composite, DateFormat, PrintConv, Unknown and Verbose.
Return Value:
1 if image was valid, 0 otherwise (and 'Error' tag set).

GetInfo

GetInfo is called to return meta information after it has been extracted from the image by a previous call to ExtractInfo or ImageInfo. This function may be called repeatedly after a single call to ExtractInfo or ImageInfo.

    # Get image width and hieght only
    $info = $exifTool->GetInfo('ImageWidth', 'ImageHeight');

    # Get information for all tags in list (list updated with tags found)
    $info = $exifTool->GetInfo(\@ioTagList);

    # Get all information in Author or Location groups
    $info = $exifTool->GetInfo({Group2 => ['Author', 'Location']});
Inputs:
Inputs are the same as ExtractInfo and ImageInfo except that an image can not be specified. Options in effect are: Duplicates, Exclude, Group#, (and Sort if tag list reference is given).
Return Value:
Reference to information hash, the same as with ImageInfo.

WriteInfo

Write meta information to a file. The specified source file is rewritten to the destination file with the new information specified in previous calls to SetNewValue. The necessary segments and/or directories are created in the destination file as required to store the specified information. May be called repeatedly to write the same information to additional files without the need to call SetNewValue again.

    $exifTool->WriteInfo($srcfile, $dstfile);
Inputs:
0) ExifTool object reference 1) Source file name, file reference, or scalar reference 2) Destination file name, file reference, or scalar reference
Return Value:
1 if file was written OK, 2 if file was written but no changes made, 0 on file write error. If an error code is returned, an Error tag is set and GetValue('Error') can be called to obtain the error description. A Warning tag mag be set even if this routine is successful.
    $errorMessage = $exifTool->GetValue('Error');
    $warningMessage = $exifTool->GetValue('Warning');
Notes:
Will not overwrite an existing file.

CombineInfo

Combine information from more than one information hash into a single hash.

    $info = $exifTool->CombineInfo($info1, $info2, $info3);
Inputs:
0) ExifTool object reference 1-N) Information hash references

If the Duplicates option is disabled and duplicate tags exist, the order of the hashes is significant. In this case, the value used is the first value found as the hashes are scanned in order of input. The Duplicates option is the only option that is in effect for this function.

GetTagList

Get a sorted list of tags from the specified information hash or tag list.

    @tags = $exifTool->GetTagList($info, 'Group0');
Inputs:
0) ExifTool object reference, 1) [optional] Information hash reference or tag list reference, 2) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#'). If the information hash or tag list reference is not provided, then the list of found tags from the last call to ImageInfo, ExtractInfo or GetInfo is used instead, and the result is the same as if GetFoundTags was called. If sort order is not specified, the sort order is taken from the current options settings.
Return Values:
A list of tags in the specified order.

GetFoundTags

Get list of found tags in specified sort order. The found tags are the tags for the information obtained from the most recent call to ImageInfo, ExtractInfo or GetInfo for this object.

    @tags = $exifTool->GetFoundTags('File');
Inputs:
0) ExifTool object reference 1) [optional] Sort order ('File', 'Input', 'Alpha' or 'Group#') If sort order is not specified, the sort order from the ExifTool options is used.
Return Values:
A list of tags in the specified order.

GetRequestedTags

Get list of requested tags. These are the tags that were specified in the arguments of the most recent call to ImageInfo, ExtractInfo or GetInfo, including tags specified via a tag list reference. Shortcut tags are expanded in the list.

    @tags = $exifTool->GetRequestedTags();
Inputs:
(none)
Return Values:
List of requested tags in the same order that they were specified. Note that this list will be empty if tags were not specifically requested (ie. If extracting all tags).

GetValue

Get the value of specified tag. By default this routine returns the human-readable (PrintConv) value, but optionally returns the machine-readable (ValueConv) value. Note that the PrintConv value will only differ from the ValueConv value if the PrintConv option is enabled (which it is by default), or if the values form a list. In the case of a list of values (as can happen with the 'Keywords' tag for instance), PrintConv returns a comma-separated string of values, while ValueConv returns a reference to an array of values or the array itself in list context. The PrintConv values are the values returned by ImageInfo and GetInfo in the tag/value hash.

    # PrintConv example
    my $val = $exifTool->GetValue($tag);
    if (ref $val eq 'SCALAR') {
        print "$tag = (unprintable value)\n";
    } else {
        print "$tag = $val\n";
    }

    # ValueConv examples
    my $val = $exifTool->GetValue($tag, 'ValueConv');
    if (ref $val eq 'ARRAY') {
        print "$tag is a list of values\n";
    } elsif (ref $val eq 'SCALAR') {
        print "$tag represents binary data\n";
    } else {
        print "$tag is a simple scalar\n";
    }

    my @keywords = $exifTool->GetValue('Keywords', 'ValueConv');
Inputs:
0) ExifTool object reference 1) Tag key 2) [optional] Value type, 'PrintConv' (default) or 'ValueConv'
Return Values:
The value of the specified tag. If the tag represents a list of values then a comma-separated string of values is returned for PrintConv if the List option is disabled, otherwise a reference to the list of values is returned in scalar context, or the list itself is returned in list context. Values may also be scalar references to binary data.

SetNewValue

Set the new value for a tag. The new value is the value that will be written for this tag in subsequent calls to WriteInfo.

For tag lists (like Keywords), call repeatedly with the same tag name for each value in the list.

    $success = $exifTool->SetNewValue($tag, $value);

    ($success, $errStr) = $exifTool->SetNewValue($tag, $value);

    # delete a tag (also resets AddValue and DelValue options for this tag)
    $exifTool->SetNewValue($tag);

    # reset all values from previous calls to SetNewValue()
    $exifTool->SetNewValue();

    # delete a single keyword
    $exifTool->SetNewValue('Keywords', $word, DelValue => 1);

    # add a keyword without replacing existing keywords
    $exifTool->SetNewValue(Keywords => $word, AddValue => 1);

    # set a tag in a specific group
    $exifTool->SetNewValue(Headline => $val, Group => 'XMP');
Inputs:
0) ExifTool object reference 1) [optional] Tag key or tag name, or undefined to clear all new values. A tag name of '*' can be used when deleting tags to delete all tags, or all tags in a specified group. The tag name may be prefixed by group name, separated by a colon (ie. 'GROUP:TAG'), which is equivalent to using a 'Group' option argument. 2) [optional] New value for tag. Undefined to delete tag from file. 3-N) [optional] SetNewValue options hash entries (see below)
SetNewValue Options:
Type
The type of value being set. Valid values are PrintConv, ValueConv or Raw. Default is PrintConv.
AddValue
Specifies that the value be added to an existing list rather than replacing the list. Valid values are 0 or 1. Default is 0.
DelValue
Delete the exisiting tag if it has the specified value. Valid values are 0 or 1. Default is 0.
Group
Specifies group name where tag should be written. If not specified, tag is written to hightest priority group as specified by SetNewGroups. Any family 0 or 1 group name may be used. Case is not significant.
Protected
Bit mask for tag protection levels to write. Bit 0x01 allows writing of 'unsafe' tags. Bit 0x02 allows writing of 'protected' tags, and should only be used internally by ExifTool. See Image::ExifTool::TagNames, for a list of tag names indicating 'unsafe' and 'protected' tags. Default is 0.
Replace
Flag to replace the previous new value for this tag (ie. replace the value set in a previous call to SetNewValue). Valid values are 0 (don't repace), 1 (replace with specified new value) or 2 (reset previous new value only).
Return Values:
The number of tags set and prints any errors in scalar context, or the number of tags set and the error string in list context.

SetNewValuesFromFile

A very powerful routine that sets new values for tags from information found in a specified file.

    $info = $exifTool->SetNewValuesFromFile($srcFile, @tags);
Inputs:
0) ExifTool object reference 1) File name, file reference, or scalar reference 2-N) [optional] List of tag names to set. All writable tags are set if none are specified. The tag names are not case sensitive, and may be prefixed by an optional family 0 or 1 group name, separated by a colon (ie. 'exif:iso'). A leading '-' indicates tags to be excuded (ie. '-comment'). An asterisk ('*') may be used for the tag name, and is useful when a group is specified to set all tags from a group (ie. 'XMP:*'). A special feature allows tag names of the form 'SRCTAG>DSTTAG' (or 'DSTTAG<SRCTAG') to be specified to copy information to a tag with a different name or a specified group. Both 'SRCTAG' and 'DSTTAG' may use '*' and/or be prefixed by a group name (ie. 'modifyDate>fileModifyDate' or '*>xmp:*'). Tags are evaluated in order, so exclusions apply only to tags included earlier in the list. By default, this routine will commute information between same-named tags in different groups, allowing information to be translated between images with different formats. This behaviour may be modified by specifying a group name for extracted tags (even if '*' is used as a group name), in which case the information is written to the original group, unless redirected to a different group. (For example, a tag name of '*:*' may be specified to copy all information while preserving the original groups.)
Return Values:
A hash of information that was set successfully. May include Warning or Error entries if there were problems reading the input file.
Notes:
If a preview image exists, it is not copied. The preview image must be transferred separately if desired.

GetNewValues

Get list of new Raw values for the specified tag. These are the values that will be written to file. Only tags which support a 'List' may return more than one value.

    $rawVal = $exifTool->GetNewValues($tag);

    @rawVals = $exifTool->GetNewValues($tag);
Inputs:
0) ExifTool object reference 1) Tag key or tag name
Return Values:
List of new Raw tag values. The list may be empty if the tag is being deleted (ie. if SetNewValue was called without a value).

CountNewValues

Return the total number of new values set.

    $numSet = $exifTool->CountNewValues();
Inputs:
0) ExifTool object reference
Return Values:
The total number of tags with new values set.

SaveNewValues

Save state of new values to be later restored by RestoreNewValues.

    $exifTool->SaveNewValues();         # save state of new values
    $exifTool->SetNewValue(ISO => 100); # set new value for ISO
    $exifTool->WriteInfo($src, $dst1);  # write ISO + previous new values
    $exifTool->RestoreNewValues();      # restore previous new values
    $exifTool->WriteInfo($src, $dst2);  # write previous new values only
Inputs:
0) ExifTool object reference
Return Value:
None.

RestoreNewValues

Restore new values to the settings that existed when SaveNewValues was last called. May be called repeatedly after a single call to SaveNewValues. See SaveNewValues above for an example.

Inputs:
0) ExifTool object reference
Return Value:
None.

SetFileModifyDate

Set the file modification time from the new value of the FileModifyDate tag.

    $result = $exifTool->SetFileModifyDate($file);
Inputs:
0) ExifTool object reference 1) File name
Return Value:
1 if the time was changed, 0 if the FileModifyDate tag wasn't set, or -1 if there was an error setting the time.

SetNewGroups

Set the order of the preferred groups when adding new information. In subsequent calls to SetNewValue, new information will be created in the first valid group of this list. The default order is EXIF, GPS, IPTC, XMP and MakerNotes. Any family 0 group name may be used. Case is not significant.

    $exifTool->SetNewGroups('XMP','EXIF','IPTC');
Inputs:
0) ExifTool object reference 1-N) Groups in order of priority. If no groups are specified, the priorities are reset to the defaults.
Return Value:
None.

GetNewGroups

Get current group priority list.

    @groups = $exifTool->GetNewGroups();
Inputs:
0) ExifTool object reference
Return Values:
List of group names in order of write priority. Highest priority first.

GetTagID

Get the ID for the specified tag. The ID is the IFD tag number in EXIF information, the property name in XMP information, or the data offset in a binary data block. For some tags, such as Composite tags where there is no ID, an empty string is returned.

    $id = $exifTool->GetTagID($tag);
Inputs:
0) ExifTool object reference 1) Tag key
Return Values:
Tag ID or '' of there is no ID for this tag.

GetDescription

Get description for specified tag. This function will always return a defined value. In the case where the description doesn't exist, the tag name is returned.

Inputs:
0) ExifTool object reference 1) Tag key
Return Values:
A description for the specified tag.

GetGroup

Get group name for specified tag.

    $group = $exifTool->GetGroup($tag, 0);
Inputs:
0) ExifTool object reference 1) Tag key 2) [optional] Group family number
Return Values:
Group name (or 'Other' if tag has no group). If no group family is specified, GetGroup returns the name of the group in family 0 when called in scalar context, or the names of groups for all families in list context. See GetAllGroups for a list of groups in each famly.

GetGroups

Get list of group names for specified information.

    @groups = $exifTool->GetGroups($info, 2);
Inputs:
0) ExifTool object reference 1) [optional] Info hash ref (default is all extracted info) 2) [optional] Group family number (default 0)
Return Values:
List of group names in alphabetical order. If information hash is not specified, the group names are returned for all extracted information.

BuildCompositeTags

Builds composite tags from required tags. The composite tags are convenience tags which are derived from the values of other tags. This routine is called automatically by ImageInfo and ExtractInfo if the Composite option is set.

Inputs:
0) ExifTool object reference
Return Values:
(none)
Notes:
Tag values are calculated in alphabetical order unless a tag Require's or Desire's another composite tag, in which case the calculation is deferred until after the other tag is calculated. Composite tags may need to read data from the image for their value to be determined, so for these BuildCompositeTags must be called while the image is available. This is only a problem if ImageInfo is called with a filename (as opposed to a file reference or scalar reference) since in this case the file is closed before ImageInfo returns. However if you enable the Composite option, BuildCompositeTags is called from within ImageInfo before the file is closed.

GetTagName [static]

Get name of tag from tag key. This is a convenience function that strips the embedded copy number, if it exists, from the tag key.

Note: static in the heading above indicates that the function does not require an ExifTool object reference as the first argument. All functions documented below are also static.

    $tagName = Image::ExifTool::GetTagName($tag);
Inputs:
0) Tag key
Return Value:
Tag name. This is the same as the tag key but has the copy number removed.

GetShortcuts [static]

Get a list of shortcut tags.

Inputs:
(none)
Return Values:
List of shortcut tags (as defined in Image::ExifTool::Shortcuts).

GetAllTags [static]

Get list of all available tag names.

    @tagList = Image::ExifTool::GetAllTags();
Inputs:
(none)
Return Values:
A list of all available tags in alphabetical order.

GetWritableTags [static]

Get list of all writable tag names.

    @tagList = Image::ExifTool::GetWritableTags();
Inputs:
(none)
Return Values:
A list of all writable tags in alphabetical order. These are the tags for which the values may be set through SetNewValue.

GetAllGroups [static]

Get list of all group names in specified family.

    @groupList = Image::ExifTool::GetAllGroups($family);
Inputs:
0) Group family number (0-2)
Return Values:
A list of all groups in the specified family in alphabetical order.

Three families of groups are currently defined: 0, 1 and 2. Families 0 and 1 are based on the file structure, and family 2 classifies information based on the logical category to which the information refers.

Families 0 and 1 are similar except that family 1 is more specific, and sub-divides the EXIF, MakerNotes, XMP and ICC_Profile groups to give more detail about the specific location where the information was found. The EXIF group is split up based on the specific IFD (Image File Directory), the MakerNotes group is divided into groups for each manufacturer, and the XMP group is separated based on the XMP namespace prefix. Note that only common XMP namespaces are listed below but additional namespaces may be present in some XMP data. Also note that the 'XMP-xmp...' group names may appear in the older form 'XMP-xap...' since these names evolved as the XMP standard was developed. The ICC_Profile group is broken down to give information about the specific ICC_Profile tag from which multiple values were extracted. As well, information extracted from the ICC_Profile header is separated into the ICC-header group.

Here is a complete list of groups for each family:

Family 0 (General Location):
APP12, BMP, Canon, Composite, EXIF, ExifTool, File, GPS, GeoTiff, ICC_Profile, ID3, IPTC, JFIF, Jpeg2000, Leaf, MIFF, MNG, MakerNotes, PICT, PDF, PNG, Pentax, Photoshop, PostScript, PrintIM, QuickTime, WAV, XMP
Family 1 (Specific Location):
APP12, BMP, Canon, CanonCustom, CanonRaw, Casio, Composite, ExifIFD, ExifTool, File, FujiFilm, GPS, GeoTiff, GlobParamIFD, ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-view, ICC_Profile, ID3, ID3v1, ID3v2_2, ID3v2_3, ID3v2_4, IFD0, IFD1, IPTC, InteropIFD, JFIF, Jpeg2000, Kodak, KodakBordersIFD, KodakEffectsIFD, Leaf, LeafSubIFD, MIFF, MNG, MakerUnknown, Minolta, Nikon, NikonPreview, Olympus, PICT, PDF, PNG, Panasonic, Pentax, Photoshop, PostScript, PrintIM, QuickTime, Ricoh, SRF#, Sanyo, Sigma, Sony, SubIFD, Track#, WAV, XMP, XMP-PixelLive, XMP-aux, XMP-cc, XMP-crs, XMP-dc, XMP-dex, XMP-exif, XMP-iptcCore, XMP-pdf, XMP-photoshop, XMP-tiff, XMP-xmp, XMP-xmpBJ, XMP-xmpMM, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg
Family 2 (Category):
Audio, Author, Camera, ExifTool, Image, Location, Other, Printing, Time, Unknown

GetFileType [static]

Get type of file given file name.

    my $type = Image::ExifTool::GetFileType($filename);
Inputs:
0) File name (or just an extension)
Return Value:
A string, based on the file extension, which represents the type of file. Returns undefined value if file type is not supported by ExifTool. In array context, may return more than one file type if the file may be different formats.

AUTHOR

Copyright 2003-2005, Phil Harvey

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

CREDITS

Many people have helped in the development of ExifTool through their bug reports, comments and suggestions, and/or additions to the code. See html/index.html in the Image::ExifTool distribution package for a list of people who have contributed to this project.

SEE ALSO