Image::ExifTool(3)

✨ Image::ExifTool(3) ✨

okay bestie, welcome to the user-contributed Perl documentation for Image::ExifTool. This is literally the manual page, and it's giving main character energy for reading and writing meta info. Let's go. 💖


💖 NAME 💖

Image::ExifTool - Read and write meta information


🌸 SYNOPSIS 🌸

here's the quickie synopsis, no cap:

use Image::ExifTool qw(:Public);

# ---- 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 = Image::ExifTool->new;

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

so this module reads and writes meta information in a huge variety of files. It even handles the maker notes of many digital cameras from tons of manufacturers like Apple, Canon, Casio, DJI, FLIR, FujiFilm, GE, Google, GoPro, HP, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon, Nintendo, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Phase One, Reconyx, Ricoh, Samsung, Sanyo, Sigma/Foveon and Sony. slay.

Below is a list of file types and meta information formats currently supported by ExifTool (r = read, w = write, c = create):

         File Types
         ------------+-------------+-------------+-------------+------------
         360   r/w   | DR4   r/w/c | JP2   r/w   | ODS   r     | RW2   r/w
         3FR   r     | DSF   r     | JPEG  r/w   | ODT   r     | RWL   r/w
         3G2   r/w   | DSS   r     | JSON  r     | OFR   r     | RWZ   r
         3GP   r/w   | DV    r     | JXL   r/w   | OGG   r     | RM    r
         7Z    r     | DVB   r/w   | K25   r     | OGV   r     | SEQ   r
         A     r     | DVR-MS r    | KDC   r     | ONP   r     | SKETCH r
         AA    r     | DYLIB r     | KEY   r     | OPUS  r     | SO    r
         AAC   r     | EIP   r     | KVAR  r     | ORF   r/w   | SR2   r/w
         AAE   r     | EPS   r/w   | LA    r     | ORI   r/w   | SRF   r
         AAX   r/w   | EPUB  r     | LFP   r     | OTF   r     | SRW   r/w
         ACR   r     | ERF   r/w   | LIF   r     | PAC   r     | SVG   r
         AFM   r     | EXE   r     | LNK   r     | PAGES r     | SWF   r
         AI    r/w   | EXIF  r/w/c | LRV   r/w   | PBM   r/w   | THM   r/w
         AIFF  r     | EXR   r     | M2TS  r     | PCAP  r     | TIFF  r/w
         APE   r     | EXV   r/w/c | M4A/V r/w   | PCAPNG r    | TNEF  r
         ARQ   r/w   | F4A/V r/w   | MACOS r     | PCD   r     | TORRENT r
         ARW   r/w   | FFF   r/w   | MAX   r     | PCX   r     | TTC   r
         ASF   r     | FITS  r     | MEF   r/w   | PDB   r     | TTF   r
         AVI   r     | FLA   r     | MIE   r/w/c | PDF   r/w   | TXT   r
         AVIF  r/w   | FLAC  r     | MIFF  r     | PEF   r/w   | URL   r
         AZW   r     | FLIF  r/w   | MKA   r     | PFA   r     | VCF   r
         BMP   r     | FLV   r     | MKS   r     | PFB   r     | VNT   r
         BPG   r     | FPF   r     | MKV   r     | PFM   r     | VRD   r/w/c
         BTF   r     | FPX   r     | MNG   r/w   | PGF   r     | VSD   r
         C2PA  r     | GIF   r/w   | MOBI  r     | PGM   r/w   | VSDX  r
         CHM   r     | GLV   r/w   | MODD  r     | PLIST r     | WAV   r
         COS   r     | GPR   r/w   | MOI   r     | PICT  r     | WDP   r/w
         CR2   r/w   | GZ    r     | MOS   r/w   | PMP   r     | WEBP  r/w
         CR3   r/w   | HDP   r/w   | MOV   r/w   | PNG   r/w   | WEBM  r
         CRM   r/w   | HDR   r     | MP3   r     | PPM   r/w   | WMA   r
         CRW   r/w   | HEIC  r/w   | MP4   r/w   | PPT   r     | WMV   r
         CS1   r/w   | HEIF  r/w   | MPC   r     | PPTX  r     | WOFF  r
         CSV   r     | HTML  r     | MPG   r     | PS    r/w   | WOFF2 r
         CUR   r     | ICC   r/w/c | MPO   r/w   | PSB   r/w   | WPG   r
         CZI   r     | ICO   r     | MQV   r/w   | PSD   r/w   | WTV   r
         DCM   r     | ICS   r     | MRC   r     | PSP   r     | WV    r
         DCP   r/w   | IDML  r     | MRW   r/w   | QTIF  r/w   | X3F   r/w
         DCR   r     | IIQ   r/w   | MXF   r     | R3D   r     | XCF   r
         DFONT r     | IND   r/w   | NEF   r/w   | RA    r     | XISF  r
         DIVX  r     | INSP  r/w   | NKA   r     | RAF   r/w   | XLS   r
         DJVU  r     | INSV  r     | NKSC  r/w   | RAM   r     | XLSX  r
         DLL   r     | INX   r     | NRW   r/w   | RAR   r     | XMP   r/w/c
         DNG   r/w   | ISO   r     | NUMBERS r   | RAW   r/w   | ZIP   r
         DOC   r     | ITC   r     | NXD   r     | RIFF  r     |
         DOCX  r     | J2C   r     | O     r     | RSRC  r     |
         DPX   r     | JNG   r/w   | ODP   r     | RTF   r     |

         Meta Information
         ----------------------+----------------------+---------------------
         EXIF           r/w/c  |  CIFF           r/w  |  Ricoh RMETA    r
         GPS            r/w/c  |  AFCP           r/w  |  Picture Info   r
         IPTC           r/w/c  |  Kodak Meta     r/w  |  Adobe APP14    r
         XMP            r/w/c  |  FotoStation    r/w  |  MPF            r
         MakerNotes     r/w/c  |  PhotoMechanic  r/w  |  Stim           r
         Photoshop IRB  r/w/c  |  JPEG 2000      r    |  DPX            r
         ICC Profile    r/w/c  |  DICOM          r    |  APE            r
         MIE            r/w/c  |  Flash          r    |  Vorbis         r
         JFIF           r/w/c  |  FlashPix       r    |  SPIFF          r
         Ducky APP12    r/w/c  |  QuickTime      r    |  DjVu           r
         PDF            r/w/c  |  Matroska       r    |  M2TS           r
         PNG            r/w/c  |  MXF            r    |  PE/COFF        r
         Canon VRD      r/w/c  |  PrintIM        r    |  AVCHD          r
         Nikon Capture  r/w/c  |  FLAC           r    |  ZIP            r
         GeoTIFF        r/w/c  |  ID3            r    |  (and more)

🎀 CONFIGURATION 🎀

you can add your own user-defined tags via the ExifTool configuration file, or by defining the %Image::ExifTool::UserDefined hash before calling any ExifTool methods. See "ExifTool_config" in the ExifTool distribution for more details.

By default ExifTool looks for a configuration file named ".ExifTool_config" first in your home directory, then in the directory of the application script. But a different directory may be specified by setting the EXIFTOOL_HOME environment variable, or a different file may be specified by setting the ExifTool "configFile" variable before using Image::ExifTool. For example:

BEGIN { $Image::ExifTool::configFile = '/Users/phil/myconfig.cfg' }
use Image::ExifTool;

The configuration feature may also be disabled by setting "configFile" to an empty string:

BEGIN { $Image::ExifTool::configFile = '' }
use Image::ExifTool;

💅 EXPORTS 💅

Exports nothing by default, but ImageInfo and all static methods may be exported with the :Public export list.


👑 METHODS 👑

All ExifTool features are accessed through the methods of the public interface listed below. Other Image::ExifTool methods and modules should not be accessed directly because their interface may change with future versions.

None of these methods should ever die or issue warnings to STDERR if called with the proper arguments (with the exception of SetNewValue which may send an error message to STDERR, but only when called in scalar context). Error and warning messages that occur during processing are stored in the values of the Error and Warning tags, and are accessible via the GetValue method to retrieve a single Error or Warning message, or GetInfo to retrieve any number of them.

The ExifTool methods are not thread safe. periodt.

✨ new ✨

Creates a new ExifTool object.

$exifTool = Image::ExifTool->new;

One ExifTool object may be used to process many files, so creating multiple ExifTool objects usually is not necessary.

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(). eg)

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

🦋 ImageInfo 🦋

Read image file and return meta information. This is the one step function for retrieving 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
%options = (PrintConv => 0);
@tagList = qw(filename imagesize xmp:creator exif:* -ifd1:*);
$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 comes 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. Advantages of using the object-oriented form are that options may be set before calling ImageInfo, and the object may be used afterward to access member functions. Must be the first argument if used.
  • 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. All tags are returned if no tags are specified.

Tag names

okay so tag names are case-insensitive, bestie, and you can prefix them with optional group names separated by colons. A group name can start with a family number (eg. 1IPTC:Keywords) to keep your match locked to one specific family. Inside the tag name itself, ? matches any single character and * matches zero or more characters — so GROUP:* is literally "every tag in this specific group," slay. 🎀

Wildcards are not allowed in group names, with one iconic exception: a group name of * can be used to extract all available instances of a tag regardless of the Duplicates setting (eg. *:WhiteBalance). And yes you can stack groups — multiple groups may be specified (eg. EXIF:Time:* extracts all EXIF Time tags). And finally: a leading - means "exclude this tag" (eg. -IFD1:*), or a trailing # makes the ValueConv value get returned for that tag. 🦋

ngl this next bit matters: keys in the returned information hash and elements of the returned tag list are not necessarily the same as these tag names, because group names get removed, the case may be changed, and an instance number may be added. So fr fr, it's best to use either the keys of the returned hash or the elements of the returned tag list when you're accessing tag 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 info in an image, the FileName and Directory tags will not be returned. (Also, a number of the File System tags won't be returned unless it's a plain file.) Image processing begins at the current file position, and on return the file position is unspecified — so like, don't count on it. It may be either a standard filehandle or a reference to a File::RandomAccess object. Heads up: the file stays open and must be closed by the caller after ImageInfo returns. 💅

[Advanced: to let a non-rewindable stream (eg. a network socket) be re-read after processing with ExifTool, first wrap the file reference in a File::RandomAccess object, then pass this object to ImageInfo. The File::RandomAccess object will buffer the file if necessary, and may be used to re-read the file after ImageInfo returns.]

SCALAR ref

A reference to image data in memory. 🧠✨

ARRAY ref

A reference to a list of tag names. On entry, any elements in the list are added to the list of requested tags, and tags with names beginning with - are excluded. On return, this list is updated to contain an ordered list of tag keys for the returned information.

There will be 1:1 correspondence between the requested tags and the returned tag keys only if the Duplicates option is 0 and Sort is 'Input'. (With Duplicates enabled, there may be more entries in the returned list of tag keys, and with other Sort settings the entries may not be in the same order as requested.) And if a requested tag doesn't exist? A tag key is still generated, but the tag value is undefined. 🙈

Note: do not reuse this list in subsequent calls to ImageInfo, because it returns tag keys, not names, and the list will grow for each call — which results in increasingly slower performance. Don't do that to yourself. 💀

HASH ref

A reference to a hash containing the options settings valid for this call only. See the 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-key/value pairs. The tag keys are identifiers — essentially case-sensitive tag names with an appended instance number if multiple tags with the same name were extracted from the image. Many of the ExifTool functions require a tag key as an argument, so use GetTagName [static] to get the tag name for a given tag key. Note that the case of the tag names may not be the same as requested. Here's 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. Also, a hash reference may be returned if the Struct option is used (see the OrderedKeys option to obtain the hash keys). Lists of values are joined by commas into a single string only if the PrintConv option is enabled and the ListJoin option is enabled (which are the defaults). And note: binary values are not necessarily extracted unless specifically requested, or the Binary option is enabled and the tag is not specifically excluded. 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 = Image::ExifTool->new;
$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);
}

Notes:

ExifTool returns all values as byte strings of encoded characters — Perl wide characters are not used. See CHARACTER ENCODINGS for details about the encodings. By default, most returned values are encoded in UTF-8. For these, Encode::decode_utf8() may be used to convert to a sequence of logical Perl characters. 🦋

As well as tags representing information extracted from the image, the following Extra tags generated by ExifTool may be returned:

ExifToolVersion - The ExifTool version number.

Error - An error message if the image could not be processed.

Warning - A warning message if problems were encountered while
          processing the image.

✨ Options ✨

Get/set ExifTool options. You call this function to set the default options for an ExifTool object. Options set this way are in effect for all function calls, but they may be overridden by options passed as arguments to some functions. Option names are not case sensitive, but option values are. 😌

The default option values may be changed by defining a %Image::ExifTool::UserDefined::Options hash. See the ExifTool_config file in the full ExifTool distribution for examples. And unless otherwise noted, a default of undef has the same effect as a value of 0 for options with numerical values.

# 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);

# reset DateFormat option
$exifTool->Options(DateFormat => undef);

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

# get current Verbose setting
$isVerbose = $exifTool->Options('Verbose');

# set a user parameter
$exifTool->Options(UserParam => 'MyParam=some value');

Inputs:

  1. ExifTool object reference
  2. Option parameter name (case-insensitive)
  3. [optional] Option parameter value (may be undef to clear option)
  4. 3-N) [optional] Additional parameter/value pairs

Option Parameters:

Quick note, bestie: these API options may also be used in the exiftool application via the command-line -api option. 💅
  • Binary — Flag to extract the value data for all binary tags. Tag values representing large binary data blocks (eg. ThumbnailImage) are not necessarily extracted unless this option is set or the tag is specifically requested by name. Default is undef.
  • BlockExtract — Flag to extract some directories (mentioned in the ExifTool tag name documentation) as a block. Setting this to a value of 2 also prevents parsing the block to extract tags contained within.
  • ByteOrder — The byte order for newly created EXIF segments when writing. Note that if EXIF information already exists, the existing order is maintained. Valid values are 'MM', 'II' and undef. If ByteOrder is not defined (the default), then the maker note byte order is used (if they are being copied), otherwise big-endian ('MM') order is assumed. This can also be set via the ExifByteOrder tag, but the ByteOrder option takes precedence if both are set.
  • ByteUnit — Units for print conversion of FileSize and other byte values. Either 'SI' (eg. kB for 1000 bytes) or 'Binary' (eg. KiB for 1024 bytes). Default is 'SI'.
  • Charset — Character set for encoding character tag values passed to/from ExifTool with code points above U+007F. Default is 'UTF8'. Valid values are listed below, case is not significant:

...and honestly bestie, the value list is a whole vibe menu, so here's every single one, no skips 💅

  • UTF8 (aka cp65001, UTF-8) — UTF-8 characters ✨
  • Latin (aka cp1252, Latin1) — Windows Latin1 (West European)
  • Latin2 (aka cp1250) — Windows Latin2 (Central European)
  • Cyrillic (aka cp1251, Russian) — Windows Cyrillic
  • Greek (aka cp1253) — Windows Greek
  • Turkish (aka cp1254) — Windows Turkish
  • Hebrew (aka cp1255) — Windows Hebrew
  • Arabic (aka cp1256) — Windows Arabic
  • Baltic (aka cp1257) — Windows Baltic
  • Vietnam (aka cp1258) — Windows Vietnamese
  • Thai (aka cp874) — Windows Thai
  • DOSLatinUS (aka cp437) — DOS Latin US
  • DOSLatin1 (aka cp850) — DOS Latin1
  • DOSCyrillic (aka cp866) — DOS Cyrillic
  • MacRoman (aka cp10000, Roman) — Macintosh Roman
  • MacLatin2 (aka cp10029) — Macintosh Latin2 (Central Europe)
  • MacCyrillic (aka cp10007) — Macintosh Cyrillic
  • MacGreek (aka cp10006) — Macintosh Greek
  • MacTurkish (aka cp10081) — Macintosh Turkish
  • MacRomanian (aka cp10010) — Macintosh Romanian
  • MacIceland (aka cp10079) — Macintosh Icelandic
  • MacCroatian (aka cp10082) — Macintosh Croatian

Lowkey crucial heads-up: this option hits some types of info when you're reading/writing the file and other types when you're getting/setting tag values — so you gotta define it for both kinds of access. Wanna know how special characters are handled? Go peek at the CHARACTER ENCODINGS section, it's all there. 🫶


CharsetEXIF 🦋

The internal encoding to use for stored EXIF "ASCII" string values. You can also set it to undef to pass through EXIF "ASCII" values with zero recoding. Set it to "UTF8" if you wanna conform with the MWG recommendation. Default is undef.

CharsetFileName 🌸

The external character set used for file names handed to ExifTool functions. Default is undef, but "UTF8" is assumed in Windows if the file name contains special characters and is valid UTF8. You can also set it to an empty string to dodge those "encoding must be specified" warnings on Windows. 🙈

CharsetID3 🎀

The internal encoding to assume for ID3v1 strings. By the spec, ID3v1 strings should be encoded in ISO 8859-1 (basically Latin), but some applications out here doing their own thing and using local encoding instead. Default is 'Latin'.

CharsetIPTC 🧚

The fallback internal IPTC character set to assume if the IPTC info contains no CodedCharacterSet tag. Possible values are the exact same as the Charset option. Default is 'Latin'.

Reminder bestie: this option affects some types of info when reading/writing the file and other types when getting/setting tag values, so it must be defined for both types of access. ✨

CharsetPhotoshop 💜

The internal encoding to assume for Photoshop IRB resource names. Default is 'Latin'.

CharsetQuickTime 🌈

The internal encoding to assume for QuickTime strings stored with an unspecified encoding. Default is 'MacRoman'.

CharsetRIFF 🍓

The internal encoding to assume for strings in RIFF metadata (like, AVI and WAV files, yk). The default value of 0 assumes "Latin" encoding unless the RIFF CSET chunk says otherwise. Set it to undef to pass through strings without recoding. Default is 0.

Compact 💅

A comma-delimited list of settings for writing compact XMP. Here's the whole menu of settings — and bestie, note that 'NoPadding' only effects embedded XMP, since padding is never ever written for stand-alone XMP files. Also note that 'OneDesc' is not recommended when you're writing XMP larger than 64 KiB to a JPG file, because it interferes with ExifTool's technique of splitting off large rdf:Description elements into the extended XMP. Case is not significant for any of these options. Aliases go in brackets. Default is undef.

  • NoPadding — avoid 2 KiB of recommended padding at end of XMP (alias: NoPad)
  • NoIndent — no spaces to indent lines (aliases: NoSpace, NoSpaces)
  • NoNewline — avoid unnecessary newlines (alias: NoNewlines)
  • Shorthand — use XMP Shorthand format
  • OneDesc — combine properties into a single rdf:Description (alias: OneDescr)
  • AllSpace — equivalent to 'NoPadding,NoIndent,NoNewline'
  • AllFormat — equivalent to 'Shorthand,OneDesc'
  • All — equivalent to 'AllSpace,AllFormat'

Composite 🔥

A flag to generate Composite tags when extracting information. Default is 1.

Compress 🎁

A flag to write new values in compressed format if possible. Heads up: it has no effect unless the relevant compression library is available. Valid when writing metadata to PNG, JXL, HEIC or MIE images. Setting this to zero causes JXL metadata to be rewritten as uncompressed when edited. Default is undef.

CoordFormat 🌍

The format for printing GPS coordinates. It's a printf format string with specifiers for degrees, minutes and seconds, in that order — but minutes and seconds may be omitted. If the hemisphere is known, a reference direction (N, S, E or W) gets appended to each printed coordinate, but adding a "+" or "-" to the first format specifier (like "%+.6f" or "%-.6f") prints a signed coordinate instead ("+" also adds a leading plus sign to positive coordinates, while "-" does not). For example, here's the output for the same coordinate using various formats:

CoordFormat        Example Output
-----------------  ------------------
q{%d deg %d' %.2f"}  54 deg 59' 22.80"  (default for reading)
q{%d %d %.8f}        54 59 22.80000000  (default for copying)
q{%d deg %.4f min}   54 deg 59.3800 min
q{%.6f degrees}      54.989667 degrees
Note: to avoid loss of precision, the default coordinate format is different when copying tags with "SetNewValuesFromFile". 💀

DateFormat 📅

The format for printing date/time values. Check out "strftime" in the POSIX package and https://exiftool.org/filename.html#codes for all the deets about the format string. If the date can not be converted, the value is left unchanged — unless the StrictDate option is set. ExifTool adds a few extra format specifiers (%f, %s and %z) — see https://exiftool.org/filename.html#codes for more details. The inverse conversion (ie. when calling "SetNewValue") is performed only if POSIX::strptime or Time::Piece is installed. The default setting of undef causes date/time values to remain in standard EXIF format (similar to a DateFormat of "%Y:%m:%d %H:%M:%S").

Duplicates 👯

A flag to return values from tags with duplicate names when extracting information. Default is 1. It gets forced to 1 when copying tags with "SetNewValuesFromFile".

Escape 🛟

Escape special characters in extracted values for HTML or XML. It also *un*escapes HTML or XML character entities in input values passed to "SetNewValue". Valid settings are 'HTML', 'XML' or undef. Default is undef.

Exclude 🚫

Exclude specified tags when extracting information. Heads up though — this option is applied after all of the tags have already been loaded into memory (so different tags may be excluded in subsequent calls to "GetInfo"). Peep the IgnoreTags option if you wanna save memory by not loading the tags in the first place. The option value is either a tag name or a 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. You can also exclude tags by preceding their name with a '-' in the arguments to "ImageInfo". ✨

ExtendedXMP 🧵

This setting affects the reading and editing of extended XMP in JPEG images. According to the XMP specification, extended XMP is only valid if it has the GUID specified by the HasExtendedXMP tag — so by default ExifTool will ignore other extended XMP, but this option lets you have full control over the extended XMP that gets extracted. 👑

  1. 0 — ignore all extended XMP
  2. 1 — read extended XMP with valid GUID only (default)
  3. 2 — read extended XMP with any GUID
  4. <guid> — read extended XMP with a specific GUID

ExtractEmbedded 🕵️‍♀️

A flag to extract information from embedded documents in EPS files, embedded EPS information and JPEG and Jpeg2000 images in PDF files, embedded MPF images in JPEG and MPO files, metadata after the first Cluster in MKV files, timed metadata in videos, all frames of a multipart EXR image, and the resource fork of Mac OS files. A setting of 2 also causes the H264 video stream in MP4 files to be parsed until the first SEI message is decoded — or 3 to parse the entire H264 stream in MP4 videos and the entire M2TS file to look for any unlisted program containing GPS metadata. Default is undef. 💖

  • FastScan — ok bestie, this is THE speed-up flag ⚡ and it works by skipping extraction of some types of metadata. When it's set to 1, ExifTool will not scan to the end of a JPEG image to check for an AFCP, CanonVRD, FotoStation, PhotoMechanic, MIE or PreviewImage trailer. It also stops parsing after the first comment in GIF images, and at the audio/video data of RIFF-format files (AVI, WAV, etc), so any trailing metadata (eg. XMP written by some utilities) may be missed. It also disables input buffering for some types of files to reduce memory usage when reading from a non-seekable stream, and bypasses CRC validation for speed when writing PNG files. When combined with the ScanForXMP option, it prevents scanning for XMP in recognized file types. With a value of 2, ExifTool will also avoid extracting any EXIF MakerNote information, and will stop processing at the IDAT chunk of PNG images and the mdat atom in QuickTime-format files. (By the PNG specification, metadata is allowed after IDAT, but ExifTool always writes it before because some utilities will ignore it otherwise.) When set to 3 or higher, only pseudo system tags and FileType are generated. For 3, the file header is read to provide an educated guess at FileType. For 4, the file is not read at all and FileType is determined based on the file's extension. For 5, generation of Composite tags is also disabled (like setting "Composite" to 0). Default is undef.
  • Filter — a Perl expression that filters values for all the tags. The expression acts on the value of the Perl default variable ($_), and changes the value of this variable as required. The current ExifTool object may be accessed through $self. The value is not changed if $_ is set to undef. List items are filtered individually. Applies to all returned values unless the PrintConv option is disabled. 💅
  • FilterW — same energy as Filter but for PrintConv values when writing. The expression acts on the value of the Perl default variable ($_), and changes the value of this variable as required. The current ExifTool object may be accessed through $self. The tag is not written if $_ is set to undef.
  • FixBase — fixes the maker notes base offset 🛠️. A common problem with image editing software is that offsets in the maker notes are not adjusted properly when the file is modified. This may cause the wrong values to be extracted for some maker note entries when reading the edited file. FixBase specifies an integer value to be added to the maker notes base offset. It may also be set to the empty string ('') for ExifTool will take its best guess at the correct base, or undef (the default) for no base adjustment.
  • GeoDir — [Not a real option] Provided as a convenience to allow $Image::ExifTool::geoDir to be set at runtime. This variable specifies the directory for the Geolocation databases, and is used only once when these databases are loaded.
  • Geolocation — a flag to generate geolocation tags based on the GPSLatitude/GPSLongitude or City/State/Province/Country read from a file 🌍. This feature uses an included database with cities over a population of 2000 from geonames.org. May be set to a string of the form "Lat,Lon" (eg. "44.56,-72.33") or city with optional state/province, country and/or country code (eg. "Paris,France") to act as a default for files not containing GPS or geolocation information, or include tag names with leading dollar signs separated by commas to specify the tags to use for the geolocation input. When "Lat,Lon" is specified, "num=##" may be added to return the specified number of nearby cities (the "Duplicates" option must also be used for the duplicate tags to be returned). May include regular expressions for more flexible matching of city names. See <https://exiftool.org/geolocation.html> for more details. Default is undef.
  • GeolocAltNames — a flag to search alternate Geolocation city names if available (ie. if $Image::ExifTool::Geolocation::altDir has been set). Set to 0 to disable use of the alternate names. Default is 1.
  • GeolocFeature — a comma-separated list of feature codes to include in city search, or exclude if the list begins with a dash (-). Valid feature codes are PPL, PPLA, PPLA2, PPLA3, PPLA4, PPLA5, PPLC, PPLCH, PPLF, PPLG, PPLH, PPLL, PPLQ, PPLR, PPLS, PPLW, PPLX, STLMT and Other, plus possible user-include codes if an alternate database is used. See <http://www.geonames.org/export/codes.html#P> for a description of these codes. Default is undef.
  • GeolocMaxDist — maximum distance in km to the geolocation city 📏. The Geolocation tags are not generated if the distance is greater than this. Default is undef.
  • GeolocMinPop — minimum population for the Geolocation city. Cities smaller than this are ignored. Default is undef.
  • GeoMaxIntSecs — maximum interpolation time in seconds for geotagging ⏱️. Geotagging is treated as an extrapolation if the Geotime value lies between two fixes in the same track which are separated by a number of seconds greater than this. Otherwise, the coordinates are calculated as a linear interpolation between the nearest fixes on either side of the Geotime value. Set to 0 to disable interpolation and use the coordinates of the nearest fix instead (provided it is within GeoMaxExtSecs, otherwise geotagging fails). Default is 1800.
  • GeoMaxExtSecs — maximum extrapolation time in seconds for geotagging. Geotagging fails if the Geotime value lies outside a GPS track by a number of seconds greater than this. Otherwise, for an extrapolation the coordinates of the nearest fix are taken (ie. it is assumed that you weren't moving during this period). Default is 1800.
  • GeoMaxHDOP — maximum Horizontal (2D) Dilution Of Precision for geotagging. GPS fixes are ignored if the HDOP is greater than this. Default is undef.
  • GeoMaxPDOP — maximum Position (3D) Dilution Of Precision for geotagging. GPS fixes are ignored if the PDOP is greater than this. Default is undef.
  • GeoHPosErr — expression to set GPSHPositioningError based on value of GPSDOP when geotagging. For example, use '$GPSDOP * 4' to set GPSHPositioningError to 4 times GPSDOP.
  • GeoMinSats — minimum number of satellites for geotagging 🛰️. GPS fixes are ignored if the number of acquired satellites is less than this. Default is undef.
  • GeoSpeedRef — reference units for writing GPSSpeed when geotagging:
    • 'K', 'k' or 'km/h' — km/h
    • 'M', 'm' or 'mph' — mph
    • anything else — knots (default undef)
  • GeoUserTag — additional user-defined tags to write when geotagging from GPX or CSV files ✨. Format is 'TAG=TOKEN,...' where TAG is an ExifTool tag name (with optional group name), and TOKEN is the GPX property name or CSV column name. eg) "Location=desc" will write the Location tag based on the value of 'desc' in the GPS log file. The tag value is taken from the nearest fix in time. Multiple tags may be specified using comma separators. Default is undef.
  • GlobalTimeShift — time shift to apply to all extracted date/time PrintConv values 🕰️. Does not affect ValueConv values. Value is a date/time shift string (see Image::ExifTool::Shift(3pm)) with a leading '-' for negative shifts, or a tag name with option group prefix followed by '+' or '-' then the shift string. Default is undef.

Note: When specifying a number of months and/or years to shift, the tag for the starting date should be specified so the number of days can be determined unambiguously. For example:

'createdate-1:0:0 0:0:0' - shift back by the length of the
                           year before the CreateDate value
'xmp:createdate+0:2:0 0' - shift forward by the length of
                           the 2 months after XMP:CreateDate

If the starting tag is not specified, or the specified tag isn't available, then the shift is calculated based on the first shifted tag.

  • GPSQuadrant — this option is used to specify the GPS quadrant in the case where a warning was issued because the GPS quadrant couldn't be determined 🧭. The value is a 2-character code where the first character is 'N' or 'S' and the second character is 'E' or 'W' (case insensitive). If this option is not set and the quadrant is unknown, a warning is issued and the quadrant is assumed to be 'NE'.
  • 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 preceding group name with a '-'. See "GetGroup" for a description of group families, and "GetAllGroups [static]" for lists of group names.
  • HexTagIDs — return hexadecimal instead of decimal for the family 7 group names of tags with numerical ID's 🔢.
  • HtmlDump — dump information in hex to dynamic HTML web page. The value may be 0-3 for increasingly larger limits on the maximum block size. Default is 0. Output goes to the file specified by the TextOut option (\*STDOUT by default).
  • HtmlDumpBase — base for HTML dump offsets. If not defined, the EXIF/TIFF base offset is used. Set to 0 for absolute offsets. Default is undef.
  • IgnoreGroups — comma-separated list of group names to ignore when reading 🙈. The group names are case insensitive and may be preceded by a family number. Set to undef to clear the previous IgnoreGroups list. Default is undef.
  • IgnoreMinorErrors — the "bestie I'm choosing peace" flag 💅. It takes minor errors and downgrades them to warnings, and minor warnings just get fully ignored, no cap. Why would you even want this? Mainly so you can still write files when minor errors pop up. But lowkey be careful: by ignoring some minor warnings you might change how ExifTool behaves and let some questionable operations slide (like extracting thumbnail and preview images even when they have no recognizable header 🙈). How do you spot these? Minor errors and warnings literally start with [minor] at the beginning of the message, or [Minor] with a capital "M" for the warnings that actually affect processing when you ignore them.
  • IgnoreTags — comma-separated list of tag names you wanna skip when reading. Super helpful when memory is limited, because ignored tag values never get stored in memory at all. The tag names are case insensitive, but heads up: group names and wildcards are not allowed. There's also a special tag name "All" you can use to ignore everything except whatever the "RequestTags" option specifies. Set it to undef to clear the previous IgnoreTags list. Default is undef.
  • ImageHashType — picks which hash algorithm gets used for the ImageDataHash tag calculation. Supported options are 'MD5', 'SHA256', and 'SHA512'. Default is 'MD5'.
  • KeepUTCTime — flag to keep UTC times in Zulu time zone instead of converting them to local time. Only affects times that are stored as seconds since the UTC epoch. Default is undef.
  • Lang — the localized language for exiftool tag descriptions and all that. The available languages are the ones given by the Image::ExifTool::Lang module names (eg. 'fr', 'zh_cn'). If the language you asked for isn't available, the option just doesn't change — no drama. May be set to undef to pick the built-in default language. Default is 'en'.
  • LargeFileSupport — flag saying "yes this system supports 64-bit file offsets". If it's not set, processing gets aborted the moment a chunk bigger than 2 GB shows up 😭. Set to 1 to process large chunks, or 2 to process them but with a warning. Default is 1.
  • LimitLongValues — for some specific tags (usually Unknown tags), the PrintConv values get length-limited, and if a value goes over the limit it gets truncated with an ellipsis ("[...]"). This option sets that length limit. A setting of 4 or less disables the limit entirely (because the ellipsis string is longer than that lol). Default is 60.
  • ListItem — returns only one specific item from list-type values. A value of 0 returns the first item in the list, 1 returns the second item, etc. Negative indices work too, with -1 meaning the last item in the list. Only applies to the top-level list of nested lists. Default is undef to return all items in the list.
  • ListJoin — the separator used to join the PrintConv value of multi-item List-type tags into one single string. If it's not defined, multi-item lists come back as a list reference instead. Does not affect ValueConv values. Default is ', '.
  • ListSplit — a regular expression used to split values of list-type tags into individual items when writing. (eg. use ',\s*' to split a comma-separated list.) It splits when writing either PrintConv or ValueConv values. Default is undef.
  • MakerNotes — option to extract MakerNotes and other writable subdirectories (like PrintIM) as a data block. Normally when the MakerNotes get extracted they're rebuilt to include data outside the boundaries of the original maker note data block, but a value of 2 disables that feature. Possible values are:
 0 - Do not extract writable subdirectories (same as default of undef)
 1 - Extract and rebuild maker notes into self-contained block
 2 - Extract without rebuilding maker notes
  • MDItemTags — flag to extract the OS X metadata item tags (peep the "mdls" man page and "MacOS MDItem Tags" in Image::ExifTool::TagNames for more info 🍎).
  • MissingTagValue — the value used for missing tags in tag name expressions (or for tags where the advanced formatting expression returns undef). If it's not set, a minor error gets issued for missing values — or the value gets set to '' if "IgnoreMinorErrors" is set. Default is undef.
  • NoDups — flag to remove duplicate items from queued values for List-type tags when writing. Important caveat: this applies only to queued values, and it doesn't resolve duplicates against existing values in the file when you're adding to an existing list. Default is undef.
  • NoMandatory — flag to bypass writing of mandatory EXIF tags. Default is undef.
  • NoMultiExif — raises an error when you try to write multi-segment EXIF in a JPEG image. Default is undef.
  • NoPDFList — flag to avoid splitting PDF list-type tag values into separate items. Default is undef.
  • NoWarning[+] — a regular expression to suppress matching warning messages. For example, a value of "^Ignored" suppresses all warnings that begin with the word "Ignored". It has no other effect on processing, unlike IgnoreMinorWarnings for some warnings. Start the expression with "(?i)" for case-insensitive matching. Use NoWarning+ to add to existing expressions. Default is undef.
  • Password — password for reading/writing password-protected PDF documents. Ignored if a password isn't even required. The character encoding of the password is determined by the value of the Charset option at processing time. Default is undef.
  • Plot — settings to override the defaults for the SVG plot feature. The value is a comma delimited string of settings, or undef to revert back to the default settings. Settings accumulate if you set this option multiple times. And watch out — commas inside the settings must be escaped as "&#44;". The valid settings and their default values are:
  "Type=Line"           - plot type (Line, Scatter or Histogram)
  "Style=Line"          - data style (Line, Marker and/or Fill)
  "NBins=20"            - number of bins for histogram plot
  "Size=800 600"        - width,height of output image
  "Margin=60 15 15 30"  - left,top,right,bottom margins around plot area
  "Legend=0 0"          - x,y offset to shift plot legend
  "TxtPad=10 10"        - padding between text and x,y scale
  "LineSpacing=20"      - spacing between text lines
  "Stroke=1"            - plot stroke width and marker-size scaling
  Title, XLabel, YLabel - plot title and x/y axis labels (no default)
  XMin, XMax            - x axis minimum/maximum (autoscaling if not set)
  YMin, YMax            - y axis minimum/maximum
  Multi                 - flag to draw multiple plots, one for each dataset
  Split                 - flag to split strings of numbers into lists
                          (> 1 to split into lists of N items)
  "Grid=darkgray"       - grid color
  "Text=black"          - color of text and plot border
  "Bkg="                - background color (default is transparent)
  "Cols=red green blue black orange gray fuchsia brown turquoise gold"
                        - colors for plot data
  "Marks=circle square triangle diamond star plus pentagon left down right"
                        - marker-shape names for each dataset
  • PrintConv — flag to enable automatic print conversion. It also enables inverse print conversion for writing. Default is 1.
  • PrintCSV — flag to directly print CSV-format output instead of extracting tags the normal way. Currently this feature applies only to GM PDR data (see "GM Tags" in Image::ExifTool::TagNames). Setting this option automatically sets "IgnoreTags" to "all", and "ExtractEmbedded" to 1. Default is undef.
  • QuickTimeHandler — flag set to add an 'mdir' Handler to a newly created Meta box when adding QuickTime ItemList tags. Adobe Bridge doesn't add this Handler, but it's commonly found in samples from other software, and it's been reported that Apple QuickTime Player and Photos.apps will just ignore ItemList tags if this is missing 💀. Default is 1.
  • QuickTimePad — flag to preserve the padding of some QuickTime atoms when writing. QuickTime-based Canon CR3 files pad the values of container atoms with null bytes. That padding gets removed by default when the file is rewritten, but setting this option to 1 adds padding to preserve the original atom size if the new atom would be smaller than the original. Default is undef.
  • QuickTimeUTC — flag set to assume that QuickTime date/time values are stored as UTC, which causes conversion to local time when they're extracted and from local time when they're written. Per the QuickTime specification, date/time values should be UTC, but so many digital cameras store local time instead (presumably because they don't know the time zone 🙄), so the default is to not convert these times (except for Canon CR3 files, which always use UTC times). This option also disables the auto-detection of incorrect time-zero offsets in QuickTime date/time values, and enforces a time zero of 1904 as per the QuickTime specification.
  • RequestAll — flag to request all tags to be extracted. This causes some tags to be generated that normally wouldn't be, unless specifically requested (by passing the tag name to "ImageInfo" or "ExtractInfo"). May be set to 2 or 3 to enable generation of some additional tags as mentioned in the tag name documentation. Default is undef.
  • RequestTags — bestie, this is a list of extra tag and/or group names you wanna request in later calls to ExtractInfo. 🎀 It's only useful for tags/groups that don't get extracted unless you specifically ask for them, or if IgnoreTags is set to All. The value can be a list reference, a delimited string of names (any delimiter is allowed, no rules), or undef to clear the current RequestTags list. Wanna request a whole group? Just add a colon after the name (eg. "MacOS:"). Names get converted to lower case as they're added to the list. Default is undef.
  • SaveBin — flag to save binary values of tags, and you can reach them through calls to GetValue with a value type of Bin. 👑
  • SaveFormat — flag to save the EXIF/TIFF format type as the family 6 group name when extracting info. Without this option set, the family 6 group names are literally not generated. Default is undef. See GetGroup for more details. 💅
  • SavePath — flag to save the metadata path as the family 5 group name when extracting info. Without this option set, the family 5 group names are not generated. Default is undef. See the GetGroup option for more details. ✨
  • ScanForXMP — flag to scan all files (even unrecognized formats) for XMP information, unless XMP was already found in the file. When you combine it with the FastScan option, only unrecognized file types get scanned for XMP. Default is undef. 🦋
  • Sort — specifies the order to sort tags in the returned list:
    • Input — Sort in same order as input tag arguments (default)
    • File — Sort in order that tags were found in the file
    • Tag — Sort alphabetically by tag name
    • Descr — Sort by tag description (for current Lang setting)
    • Group# — Sort by tag group, where # is zero or more family numbers separated by colons. If # is not specified, Group0 is assumed. See GetGroup for a description of group families.
  • Sort2 — the secondary sort order used for tags within each group when Sort is 'Group':
    • File — Sort in order tags were found in the file (default)
    • Tag — Sort alphabetically by tag name
    • Descr — Sort by tag description (for current Lang setting)
  • StrictDate — flag to return an undefined value for any date which can't be converted when the DateFormat option is used. Default is undef. 🌸
    • undef — Same as 0 for reading/writing, or 1 for copying
    • 0 — Return date/time value unchanged if it can't be converted
    • 1 — Return undef if date/time value can't be converted

When set to 1 while writing a PrintConv date/time value with the DateFormat option set, the value is written only if POSIX::strptime or Time::Piece is available and can successfully convert the value.

For PNG CreationTime, a setting of 1 has the extra effect of making the date/time get reformatted according to PNG 1.2 recommendation (RFC-1123) when writing, plus a warning gets issued for any non-standard value when reading (but heads up: Windows may not recognize PNG date/time values in standard format). 😭

  • Struct — flag to return XMP structures as hash references instead of flattening them into individual tags. Has no effect when writing, since both flattened and structured tags may always be written. A special _ordered_keys_ element containing a list of ordered keys may exist if the structure elements are ordered (see the OrderedKeys method). Possible values are:
    • undef — (default) Same as 0 for reading, 2 for copying
    • 0 — Read/copy flattened tags
    • 1 — Read/copy structured tags
    • 2 — Read/copy both flattened and structured tags, but flag flattened tags as 'unsafe' for copying
  • StructFormat — the format for serialized structures when reading/writing. 💖
    • undef — Default ExifTool format
    • JSON — JSON format
    • JSONQ — JSON with quoted numerical values

Note that the JSONQ setting causes all values in the exiftool application -json output to be quoted, regardless of whether or not they're in a structure. 🫶

  • SystemTags — flag to extract the following additional File System tags: FileAttributes, FileDeviceNumber, FileInodeNumber, FileHardLinks, FileUserID, FileGroupID, FileDeviceID, FileBlockSize and FileBlockCount.
  • SystemTimeRes — number of digits in sub-seconds for system times and some other epoch times. A value of 0 rounds to the nearest second. Negative values cause trailing zeros to be removed. eg) A value of -6 returns system times to 6 decimal places with trailing zeros removed. Default is 0, which rounds to the nearest second. Note that round-off errors may appear starting at the 6th decimal place for some time formats. 🕰️
  • TextOut — output file reference for the Verbose and HtmlDump options. Default is \*STDOUT.
  • TimeZone — set the time zone for local date/time values. The value is a time zone offset like "+05:00" (but note that the offset is to UTC, not from UTC, so it's positive for western time zones), or a time zone name like "EST5EDT". For Unix-based systems, the value may also be a time zone ID like "America/New_York". Requires Time::Piece on Windows, or POSIX::tzset on other systems. Default is undef. 🌍
  • UndefTags — flag to maintain undefined tag values in the application -if expression when the -f or -m option is also used. Default is undef.
  • Unknown — flag to get the values of unknown tags. If set to 1, unknown tags are extracted from EXIF (or other tagged-format) directories. If set to 2, unknown tags are also extracted from binary data blocks. Default is 0. 💀
  • UserParam — special option to set/get user-defined parameters. Useful for letting external input into tag name expressions and ValueConv logic. Valid UserParam values are:
    • PARAM — Get parameter
    • PARAM= — Clear parameter
    • PARAM^= — Set parameter to empty string
    • PARAM=VALUE — Set parameter
    • <hash ref> — Set entire UserParam hash lookup
    • undef — Clear all user parameters

Where PARAM is the user-defined parameter name (case insensitive).

User-defined parameters may be accessed in tag name expressions by prefixing the parameter name with a dollar sign, just like normal tags, or via the API by calling Options('UserParam','PARAM'). Appending a hash tag ("#") to the parameter name also causes the parameter to be extracted as a normal tag (in the UserParam group). If called without additional arguments, Options('UserParam') returns a reference to the hash of all user parameters (with lower-case names). ✨

  • Validate — flag to perform extra validation metadata checks when reading, causing extra warnings to be generated if problems are found. Default is undef. 🚨
  • Verbose — print verbose messages to the file specified by the TextOut option. Value may be from 0 to 5 for increasingly verbose messages. 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. 📢
  • WindowsLongPath — support long path names in Windows. Enabling this option automatically enables the WindowsWideFile feature. Default is 1. 🪟
  • WindowsWideFile — force the use of wide-character Windows I/O functions. This may be necessary when files are on a network drive and the current directory name contains Unicode characters. Without this option, the wide-character functions are used only if the specified file path contains Unicode characters.
  • WriteMode — set tag write/create mode. Value is a string of one or more characters from the list below. Default is 'wcg'.
    • w — Write existing tags
    • c — Create new tags
    • g — create new Groups as necessary

The level of the group differs for different types of metadata. For XMP or IPTC this is the full XMP/IPTC block (the family 0 group), but for EXIF this is the individual IFD (the family 1 group). The 'w' and 'c' modes are tested only when SetNewValue is called, but the 'g' mode is also tested in WriteInfo. 💅

  • XAttrTags — flag to extract the OS X extended attribute tags (see the xattr man page and "MacOS XAttr Tags" in Image::ExifTool::TagNames for more information). 🍓
  • XMPAutoConv — flag to enable automatic conversion for unknown XMP tags with values that look like rational numbers or dates. Default is 1.

Return Values 💫

The original value of the last specified parameter.


ClearOptions 🎀

Resets all options back to their default values. It also loads user-defined default option values from the %Image::ExifTool::UserDefined::Options hash in the .ExifTool_config file, if that file exists.

$exifTool->ClearOptions();

Inputs:

  • 0) ExifTool object reference

Return Values:

(none)


ExtractInfo 🦋

Extract all the meta information from an image. Periodt.

$success = $exifTool->ExtractInfo('image.jpg', \%options);

Inputs:

ExtractInfo takes exactly the same arguments as ImageInfo. The only difference is that a list of tag keys is not returned if an ARRAY reference is given. 👑

Return Value:

1 if this was a recognized file format, 0 otherwise (and the 'Error' tag gets set). 😭


GetInfo 💖

GetInfo is called to return meta information after it's already been extracted from the image by a previous call to ExtractInfo or ImageInfo. The way this function can be called repeatedly after just one single call to ExtractInfo or ImageInfo? Iconic. 🔥

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

# get all Error and Warning messages
$info = $exifTool->GetInfo('Error', 'Warning');

# 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

okay so the inputs are literally the same as ExtractInfo and ImageInfo — EXCEPT you cannot pass it an image. That's it, that's the whole difference bestie. 💅

🌸 Return Value

A reference to the information hash, exactly the same vibe as ImageInfo. ✨


🎀 WriteInfo 🎀

Okay bestie, this is the one that actually writes stuff. 💾 WriteInfo writes meta information to a file. The source file you name gets rewritten into a same-type destination file, now carrying all the new info you specified with your earlier calls to SetNewValue. Any segments and/or directories that need to exist in the destination file to hold that information? They get created. And you can call it over and over to write the same info into more files without ever needing to call SetNewValue again. Efficiency queen. 👑

ExifTool queues up every new value you assign through calls to SetNewValue, and then applies them to however many files you want via one or more calls to WriteInfo. Those queued values are reachable through GetNewValue, and they are completely separate from the metadata extracted from files via ExtractInfo or ImageInfo and accessed through GetInfo or GetValue. Two different worlds, no crossover, no confusion. 🦋

To be clear: it is NOT necessary to call ExtractInfo or ImageInfo before WriteInfo. WriteInfo changes only the metadata specified by previous calls to SetNewValue. Periodt. 💅
# add information to a source file, writing output to new file
$exifTool->WriteInfo($srcfile, $dstfile);

# create XMP data file from scratch
$exifTool->WriteInfo(undef, $dstfile, 'XMP');

# overwrite file (you do have backups, right?)
$exifTool->WriteInfo($srcfile);

🎀 Inputs

  • 0) — ExifTool object reference
  • 1) — Source file name, file reference, scalar reference, or undef to create a file from scratch. A reference to a File::RandomAccess object is also allowed as a source, but in this case the destination is not optional.
  • 2) — [optional] Destination file name, file reference, scalar reference to write to memory, or undef to overwrite the original file. May be '-' to write to stdout. 📤
  • 3) — [optional] Destination file type. Ignored if a source is defined.

🎀 Return Value

  • 1 — file was written OK ✅
  • 2 — file was written but no changes were made
  • 0 — file write error 💀

If an error code comes back, an Error tag gets set and you can call GetValue('Error') to get the error description. A Warning tag may get set even if this routine is successful. And calling WriteInfo clears any pre-existing Error and Warning tags — fresh slate energy. ✨

$errorMessage = $exifTool->GetValue('Error');
$warningMessage = $exifTool->GetValue('Warning');

🎀 Notes

The source file name may be undefined to create a file from scratch — but currently only XMP, MIE, ICC, VRD, DR4, EXV and EXIF files can be created this way (see CanCreate for the deets). If it's undefined, the destination file type is required, unless the type can be figured out from the extension of the destination file name. 🕵️‍♀️

If you give a destination file name, that file must not already exist — because an existing destination file will not be overwritten. And any new values for FileName, Directory or HardLink are ignored when a destination file name is specified.

The destination file name may be undefined, which means overwrite the original file — and like, make sure you have backups bestie, I am begging you 😭 In that case, if a source file name is provided, a temporary file gets created and renamed to replace the source file if no errors happened while writing. Otherwise, if a source file reference or scalar reference is used, the image is first written to memory and then copied back to replace the original, as long as there were no errors.

On Mac OS systems, the file resource fork is preserved if this routine is called with a source file name. 🍎


🦋 GetTagList 🦋

Get a sorted list of tags from the information hash or tag list you hand over. 🎀

@tags = $exifTool->GetTagList($info, 'Group0');

🦋 Inputs

  • 0) — ExifTool object reference
  • 1) — [optional] Information hash reference or tag list reference
  • 2) — [optional] Sort order ('Input', 'File', 'Tag', 'Descr' or 'Group#')
  • 3) — [optional] Secondary sort order ('File', 'Tag' or 'Descr')

If you don't pass the information hash or tag list reference, 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 had been called. If you don't specify a sort order, the sort order comes from the current options settings. It just knows. 🔮

🦋 Return Values

A list of tag keys in the order you asked for. 📋


💜 GetFoundTags 💜

Get the list of found tags in the sort order you specify. The found tags are the tags for the information obtained from the most recent call to ImageInfo, ExtractInfo or GetInfo on this object. So like, whatever it last sniffed out. 🐕‍🦺

@tags = $exifTool->GetFoundTags('File');

💜 Inputs

  • 0) — ExifTool object reference
  • 1) — [optional] Sort order ('Input', 'File', 'Tag', 'Descr' or 'Group#')
  • 2) — [optional] Secondary sort order ('File', 'Tag' or 'Descr')

If you don't specify a sort order, the sort order from the ExifTool options is used. ✨

💜 Return Values

A list of tag keys in the specified order. 📋


🌈 GetRequestedTags 🌈

Get the 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. And yes, shortcut tags get expanded in the list — no shortcuts left un-shortcut. 💅

@tags = $exifTool->GetRequestedTags();

🌈 Inputs

(none) — it literally needs nothing from you, queen. 🫶

🌈 Return Values

A list of requested tag keys in the same order that the tags were specified. Note that this list will be empty if tags were not specifically requested — i.e. if you're extracting all tags. 🙈


👑 GetValue 👑

Get the value of a specified tag. 👀 The returned value is either:

  • the human-readable (PrintConv) value,
  • the converted machine-readable (ValueConv) value,
  • the original raw (Raw) value, or
  • the original rational (Rational) value for rational formats.

If you don't specify the value type, the PrintConv value is returned if the PrintConv option is set — otherwise the ValueConv value comes back. And the PrintConv values are the same as the values returned by ImageInfo and GetInfo in the tag/value hash, unless the PrintConv option is disabled. ✨

Tags that represent lists of multiple values (like 'Keywords', for example) get special handling. In scalar context, the returned PrintConv value for these tags is either a string of values or a list reference — depending on the ListJoin option setting — and the ValueConv value is always a list reference. But in list context, GetValue always returns the list itself. Periodt. 💅

Note that GetValue requires a case-sensitive tag key as an argument. If you want to retrieve tag info based on a case-insensitive tag name (with an optional group specifier), use GetInfo instead. 🙈
# 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, or case-sensitive tag name with optional group prefix(es)
  • 2) — [optional] Value type: 'PrintConv', 'ValueConv', 'Both', 'Raw', 'Bin' or 'Rational'

The default value type is 'PrintConv' if the PrintConv option is set — otherwise the default is 'ValueConv'. A value type of 'Both' returns both ValueConv and PrintConv values as a list. 'Raw' returns the raw decoded tag value. 'Bin' returns the original binary data for EXIF tags if the SaveBin option was set. And 'Rational' returns the raw rational value as a string fraction for rational types, or undef for other types. 🧮

👑 Return Values

The value of the specified tag. If the tag represents a list of multiple values and the ListJoin option is enabled, then PrintConv returns a string of values — otherwise a reference to the list is returned in scalar context. The list itself is returned in list context. (Unless 'Both' values are requested, in which case two list references are returned, regardless of context.) Values may also be scalar references to binary data, or hash references if the Struct option is set. 🎁

Note: it is possible for GetValue to return an undefined ValueConv or PrintConv value (or an empty list in list context) even if the tag exists, since it is possible for these conversions to yield undefined values. And the Rational value will be undef for any non-rational tag. The Raw value should always exist if the tag exists.

🍓 SetNewValue 🍓

Set the new value for a tag. 🎀 You can call this routine multiple times to set the values of many tags before using WriteInfo to actually write those new values to an image. And these values stay queued for writing to subsequent files until SetNewValue is called without any arguments to reset the queued values. 🧹

For list-type tags (like Keywords), either call it repeatedly with the same tag name for each value, or call it with a reference to the list of values. Both are valid, do what feels right. 💅

# set a new value for a tag (errors go to STDERR)
$success = $exifTool->SetNewValue($tag, $value);

# set a new value and capture any error message
($success, $errStr) = $exifTool->SetNewValue($tag, $value);

# delete information for specified tag if it exists in image
# (also resets AddValue and DelValue options for this tag)
$exifTool->SetNewValue($tag);

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

# delete a specific keyword
$exifTool->SetNewValue('Keywords', $word, DelValue => 1);
# set keywords (a list-type tag) with two new values
$exifTool->SetNewValue(Keywords => 'word1');
$exifTool->SetNewValue(Keywords => 'word2');
# equivalent, but set both in one call using an array reference
$exifTool->SetNewValue(Keywords => ['word1','word2']);

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

# conditionally add a tag if it didn't exist before,
# or replace it if it had a specified value ("old value")
$exifTool->SetNewValue(Description => '', DelValue => 1);
$exifTool->SetNewValue(Description => 'old value', DelValue => 1);
$exifTool->SetNewValue(Description => 'new value');

# set a tag in a specific group
$exifTool->SetNewValue(Headline => $val, Group => 'XMP');
$exifTool->SetNewValue('XMP:Headline' => $val);  # (equivalent)

# shift original date/time back by 2.5 hours
$exifTool->SetNewValue(DateTimeOriginal => '2:30', Shift => -1);

# write a tag only if it had a specific value
# (the order of the following calls is not significant)
$exifTool->SetNewValue(Title => $oldVal, DelValue => 1);
$exifTool->SetNewValue(Title => $newVal);

# write tag by numerical value
$exifTool->SetNewValue(Orientation => 6, Type => 'ValueConv');
$exifTool->SetNewValue('Orientation#' => 6);  # (equivalent)

# delete all but EXIF tags
$exifTool->SetNewValue('*');  # delete all...
$exifTool->SetNewValue('EXIF:*', undef, Replace => 2); # ...but EXIF

# write structured information as a HASH reference
$exifTool->SetNewValue('XMP:Flash' => {
    mode   => 'on',
    fired  => 'true',
    return => 'not'
});

# write structured information as a serialized string
$exifTool->SetNewValue('XMP:Flash'=>'{mode=on,fired=true,return=not}');

okay so that last bit — the structured-serialization thing — there's a whole writeup of it over at https://exiftool.org/struct.html#Serialize if you wanna go read the lore 💖

✨ Inputs <span>✨</span>

  • 0) — the ExifTool object reference, bestie. The main character. 👑
  • 1) — [optional] the tag key or tag name, or undef to clear all new values. And listen, this tag name can be prefixed by one or more family 0, 1 or 2 group names with optional leading family numbers, all separated by colons (like 'EXIF:Artist', 'XMP:Time:*') — which is literally the same thing as passing a Group option argument. Also you can slap a '#' on the end of the tag name (like 'EXIF:Orientation#') and that does the same thing as setting Type to 'ValueConv'. Wildcards ('*' and '?') are allowed in the tag name so you can assign or delete a whole bunch of tags at once. And here's the tea: a tag name of '*' is special when deleting — it deletes an entire group even if some individual tags in that group aren't writable, but only if you specified a single family 0 or 1 group (otherwise the tags just get deleted individually, one by one, no shortcuts). Use GetDeleteGroups to get a list of deletable group names, and go peek at Image::ExifTool::TagNames for the complete list of tag names. 📋
  • 2) — [optional] the new value for the tag. Undefined deletes the tag from the file. It can be a scalar, a scalar reference, a list reference (to set a list of values), or a hash reference for a structure. Integer values can be written as a hexadecimal string (with a leading '0x'), and simple rational values can go in fractional form (like '4/10'). Structure tags can be given either as a hash reference or as a serialized string (peep the last two examples up there ☝️).
  • 3-N) — [optional] SetNewValue option/value pairs (they're right below, keep scrolling).

🌸 SetNewValue Options 🌸

  • AddValue — says the value should be added to an existing list in the file instead of stomping over the existing values. Valid settings are 0 (overwrite whatever tag value is there), 1 (add to an existing list, and warn for non-list tags), or 2 (add to an existing list and overwrite non-list tags). Default is 0. ✨
  • DelValue — deletes an existing tag from a file if it has the specified value. For list-type tags this deletes a specified item from the list. For non-list tags you can use this to conditionally replace a tag by handing over a new value in a separate SetNewValue call (see the examples above, they ate 💅). For structured tags, the entire structure only gets deleted/replaced if all the specified fields match the existing structure. Option values are 0 or 1. Default is 0.
  • EditGroup — creates tags in existing groups only. Doesn't create a new group. Valid values are 0 and 1. Effectively it removes the 'g' from the ExifTool WriteMode option, but for this tag only. Default is 0.
  • EditOnly — edits a tag only if it already exists. Doesn't create a new tag. Valid values are 0 and 1. Effectively removes the 'c' from the ExifTool WriteMode option, for this tag only. Default is 0.
  • Group — specifies the group name where the tag should be written. Heads up: this option gets superseded by any group specified in the tag name itself. If you don't specify one, the tag gets written to the highest priority group as determined by SetNewGroups. It can be one or more family 0, 1 or 2 groups with an optional leading family number, separated by colons. Case is not significant. 🎀
  • NoFlat — treats flattened tags as 'unsafe'. 😬
  • NoShortcut — disables the default behaviour of looking the tag up in shortcuts if it isn't found otherwise.
  • Protected — bit mask for the tag protection levels you're allowed to write. Bit 0x01 allows writing 'unsafe' tags (meaning tags not copied automatically via SetNewValuesFromFile). Bit 0x02 allows writing 'protected' tags, and this should only be used internally by ExifTool, fr fr. See Image::ExifTool::TagNames for a list of tag names that are marked 'unsafe' and 'protected'. Default is 0.
  • ProtectSaved — avoids setting new values that were saved after the Nth call to SaveNewValues. Has no effect on unsaved values, or on values saved before that Nth call. Option value is N. Default is undef.
  • Replace — a flag to replace the previous new values for this tag (i.e. replace the values set in previous SetNewValue calls). This one's most commonly used to replace previously-set new values for list-type tags. Valid values are 0 (set new value normally — adds to new values for list-type tags), 1 (reset any previous new values before setting the new value), or 2 (reset previous new values only; the new value argument is ignored entirely 🙈). Default is 0.
  • Shift — shifts the tag by the specified value. Right now only date/time tags and tags with numerical values can be shifted. Undefined means no shift, 1 is a positive shift, -1 is a negative shift. A value of 0 causes a positive shift to be applied if the tag is shiftable and AddValue is set, or a negative shift for date/time tags only if DelValue is set. Default is undef. Go read Image::ExifTool::Shift(3pm) for more. ⏰
  • Type — the type of value being set. Valid values are PrintConv, ValueConv or Raw. Default is PrintConv if the PrintConv Option is set, otherwise ValueConv.

💖 Return Values 💖

In scalar context, it returns the number of tags set, and error messages get printed to STDERR. In list context, it returns the number of tags set and the error string (which is undefined if there was no error). No cap. 🫶

⚠️ Notes ⚠️

When you're deleting groups of tags, the Replace option can be used to exclude specific groups from a mass delete. However — and this is the important part — this technique may not be used to exclude individual tags from a group delete (unless a family 2 group was specified in the delete). Instead, use SetNewValuesFromFile to recover the values of individual tags after deleting a group. 💀

When deleting all tags from a JPEG image, the APP14 "Adobe" information is not deleted by default, because doing so may affect the appearance of the image. That said, you can delete it if you specify it explicitly — either by group (with 'Adobe:*') or as a block (with 'Adobe').


🦋 GetNewValue 🦋

Gets the new Raw value for a tag. This is the value set by SetNewValue that's queued up to be written to file. List-type tags may return multiple values in list context, so watch out. 👀

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

@rawVals = $exifTool->GetNewValue($tag);

Notes

The API NoDups option applies when this routine is called, and it removes duplicate items from the values returned for List-type tags. ✨

Inputs

  • 0) — the ExifTool object reference.
  • 1) — tag name (case sensitive, and it may be prefixed by family 0, 1 or 7 group names, separated by colons).

Return Values

A list of new Raw tag values, or the first value in the list when called in scalar context. Heads up though: the list may be empty either if the tag isn't being written, or if it's being deleted (i.e. if SetNewValue was called without a value). 😭


🌈 SetNewValuesFromFile 🌈

Okay bestie, this one is a very powerful routine that sets new values for tags from information found in a specified file. It's giving main character energy, honestly. 🔥

# set new values from all information in a file...
my $info = $exifTool->SetNewValuesFromFile($srcFile);
# ...then write these values to another image
my $result = $exifTool->WriteInfo($file2, $outFile);

# set all new values, preserving original groups
$exifTool->SetNewValuesFromFile($srcFile, '*:*');

# set specific information
$exifTool->SetNewValuesFromFile($srcFile, @tags);

# set new value from a different tag in specific group
$exifTool->SetNewValuesFromFile($fp, 'XMP-dc:Subject<IPTC:Keywords');

# add all IPTC keywords to XMP subject list
$exifTool->SetNewValuesFromFile($fp, 'XMP-dc:Subject+<IPTC:Keywords');

# set new value from an expression involving other tags
$exifTool->SetNewValuesFromFile($file,
    'Comment<ISO=$ISO Aperture=$aperture Exposure=$shutterSpeed');

# set keywords list from the values of multiple tags
$exifTool->SetNewValuesFromFile($file, { Replace => 0 },
    'keywords<xmp:subject', 'keywords<filename');

# copy all EXIF information, preserving the original IFD
# (without '*.*<' tags would be copied to the preferred EXIF IFD)
$exifTool->SetNewValuesFromFile($file, '*:*<EXIF:*');

# copy all tags with names starting with "gps" (note: this is
# different than "gps:*" because it will also copy XMP GPS tags)
$exifTool->SetNewValuesFromFile($file, 'gps*');
no cap on that last one — 'gps*' and 'gps:*' are not the same thing, so read the comment twice before you copy-paste, iykyk 👑
# set FileName from Model, translating questionable characters
$exifTool->SetNewValuesFromFile($file,
    'filename<${model; tr(/\\\\?*:|"><)(_) }.jpg');

Inputs 🫶

  • 0) — the ExifTool object reference
  • 1) — a file name, a file reference, or a scalar reference
  • 2-N) — [optional] a list of tag names to set, or options hash references. If you don't pass any, every writable tag gets set. Tag names are not case sensitive, and they can be prefixed by one or more family 0, 1, 2 or 7 group names — with optional leading family numbers — separated by colons (eg. 'exif:iso').

Okay bestie, now the flavour text on tag names, because this is where it gets juicy:

A leading '-' means "tags to be excluded" (eg. '-comment'), and a trailing '#' makes the ValueConv value get copied instead (same thing as setting the Type option to 'ValueConv' for this one tag only). A leading '+' sets the Replace option to 0 on a per-tag basis (peep the Options below). Wildcards ('*' and '?') are totally allowed inside tag names, and a tag name of '*' is the classic move when you've named a group and wanna copy everything in it (eg. 'XMP:*'). Slay.

✨ And then there's a special feature: tag names shaped like 'DSTTAG<SRCTAG' (or 'SRCTAG>DSTTAG') let you copy info into a tag with a different name, or into a specified group. Both 'SRCTAG' and 'DSTTAG' may contain wildcards and/or be prefixed by a group name (eg. 'fileModifyDate<modifyDate' or 'xmp:*<*'), and/or suffixed by a '#' to disable print conversion. Copied tags can also be added to or deleted from a list with arguments shaped like 'DSTTAG+<SRCTAG' or 'DSTTAG-<SRCTAG'. Tags get evaluated in order, so exclusions only apply to tags included earlier in the list. Keep up, it's giving choreography.

An extension of this feature lets you set a tag value from a string containing tag names with leading '$' symbols (eg. 'Comment<the file is $filename'). Braces '{}' may be used around a tag name to separate it from the text that follows, and '$$' represents a '$' symbol. What happens when a tag is missing in an expression is defined by the "MissingTagValue" option.

The tag value may be modified by changing the default input variable ($_) inside a Perl expression — that expression goes inside the braces, after a semicolon following the tag name (see that last example up top, it's iconic). A '@' may be added after the tag name (before the semicolon) to make the expression act on individual list items instead of on the concatenated string, for list-type tags. The expression gets access to the full ExifTool API through the current ExifTool object ($self) and the tag key ($tag). Braces inside the expression must be balanced. 💅

You can pass multiple options hash references to set different options for different tags, and those options apply to the tags that come after them in the argument list.

By default, this routine commutes information between same-named tags in different groups, which lets info get translated between images of different formats. You can modify that behaviour by specifying a group name for extracted tags (even if '*' is used as a group name) — then the information is written to the original group, unless it's redirected to a different group. When '*' is used as a group name, the family 1 group of the original tag is preserved by default, but you can specify a different family with a leading family number. (For example, '*:*' copies all the information while preserving the original family 1 groups, while '0*:*' preserves the family 0 group.)

SetNewValuesFromFile Options ✨

The options here are the same as for "SetNewValue", and internally they're passed straight on through to "SetNewValue", with a few exceptions:

  • The Replace option defaults to 1 instead of 0 like it does with "SetNewValue" — however, the tag name argument may be prefixed with '+' to set the Replace option to 0 for that argument only.
  • The AddValue or DelValue option is set for individual tags if '+>' or '->' (or '+<' or '-<') are used.
  • The Group option is set for tags where a group name is given.
  • The Protected flag is set to 1 for individually specified tags.
  • The Type option also applies to extracted tags.

Return Values 💖

A hash of the information that was set successfully. It may include Warning or Error entries if there were problems reading the input file. (Yes, it'll tell you. It's not gonna ghost you.)

Notes 📝

  • The PrintConv option applies to this routine, but normally you should leave it on, because it gives you more reliable transfer of information between groups.
  • If a preview image exists, it is not copied. If you want that preview image, you've gotta transfer it separately, in a separate call to "WriteInfo".
  • When you're simply copying all the information between files of the same type, you usually want to preserve the original groups by specifying '*:*' for the tags to set.
  • The "Duplicates" option is always in effect for tags extracted from the source file using this routine.
  • The "Struct" option is enabled by default for tags extracted by this routine. That lets the hierarchy of complex structures be preserved when copying — but you can set the Struct option to 0 to override that behaviour and copy as flattened tags instead.

CountNewValues 🔢

Return the total number of new values set.

$numSet = $exifTool->CountNewValues();
($numSet, $numPseudo) = $exifTool->CountNewValues();

Inputs

  • 0) — ExifTool object reference

Return Values

In scalar context, it returns the total number of tags with new values set. In list context, it also returns the number of "pseudo" tag values that have been set. "Pseudo" tags are the ones like FileName and FileModifyDate — the ones that aren't contained within the file and can be changed without rewriting the file. Sneaky little icons, love them.


SaveNewValues 💾

Save the state of new values so "RestoreNewValues" can bring them back later.

$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

The count of how many times this routine has been called (N) since the last time the new values were reset.


RestoreNewValues 🎀

Restore new values back to the settings that existed when "SaveNewValues" was last called. You can call this one over and over after a single call to "SaveNewValues" — it's very generous like that. Check the "SaveNewValues" example above if you need the visual.

Inputs

  • 0) — ExifTool object reference

Return Value

None.


SetAlternateFile 🌈

Specify an alternate file to read metadata from. Tags from the alternate file become available after "ExtractInfo" is called, or during a call to "SetNewValuesFromFile", by using a family 8 group name (eg. 'File1' in the example below).

$exifTool->SetAlternateFile(File1 => 'images/test1.jpg');

Inputs

  • 0) — ExifTool object reference
  • 1) — family 8 group name, case insensitive (eg. 'File1', 'File2'...)
  • 2) — name of the alternate input file, or undef to reset

Return Values

1 on success, or 0 if the group name is invalid.


SetFileModifyDate 🕰️

Write the filesystem modification or creation time from the new value of the FileModifyDate or FileCreateDate tag.

$exifTool->SetNewValue(FileModifyDate => '2000:01:02 03:04:05-05:00',
                       Protected => 1);
$result = $exifTool->SetFileModifyDate($file);

Inputs

  • 0) — ExifTool object reference
  • 1) — file name
  • 2) — [optional] base time if applying a shift (days before $^T)
  • 3) — [optional] tag to write: 'FileModifyDate' (the default), or 'FileCreateDate'

Return Value

1 if the time was changed, 0 if nothing was done, or -1 if there was an error setting the time.

Notes

This is equivalent to calling "WriteInfo" when only the FileModifyDate or FileCreateDate tag has been set — except it's more efficient, so it's the main character move. If a timezone isn't specified, local time is assumed. When shifting, the time of the original file is used unless the optional base time is specified.

The ability to write FileCreateDate is currently restricted to Windows systems only. Not my rules, bestie. 🪟

SetFileName 📁

Set the file name and directory, or create a hard link. If you don't specify a new name, the new file name is derived from the new values of the FileName and Directory tags — or from the HardLink or SymLink tag if you're creating a link. If the FileName tag contains a '/', the file is renamed into a new directory. If FileName ends with '/', then it's taken as a directory name and the file is moved into that new directory. And the new value for the Directory tag takes precedence over any directory specified in FileName. Periodt.

$result = $exifTool->SetFileName($file);
$result = $exifTool->SetFileName($file, $newName);

Inputs

  • 0) — ExifTool object reference
  • 1) — current file name
  • 2) — [optional] new file name
  • 3) — [optional] 'HardLink' or 'SymLink' to create a hard or symbolic link instead of renaming the file, or 'Test' to test the renaming feature by printing the old and new names instead of changing anything

Return Value

1 on success, 0 if nothing was done, or -1 if there was an error renaming the file or creating the link.

Notes

  • It will not overwrite existing files. No cap.
  • New directories are created as necessary.
  • If the file is successfully renamed, the new file name may be accessed via $$exifTool{NewName}.

SetNewGroups 🎯

Set the order of the preferred groups when adding new information. In subsequent calls to "SetNewValue", new information gets created in the first valid group of this list. This only has an impact if the group isn't specified when you call "SetNewValue", and if the tag name exists in more than one group. The default order is EXIF, IPTC, XMP, MakerNotes, QuickTime, Photoshop, ICC_Profile, CanonVRD, Adobe. 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 the current group priority list.

@groups = $exifTool->GetNewGroups();

Inputs

  • 0) — ExifTool object reference

Return Values

A list of group names in order of write priority. Highest priority first. 💖

💖 GetTagID 💖

Get the ID for the tag you're asking about. Real talk: the ID is the IFD tag number if we're in EXIF land, the property name if we're in XMP land, or the data offset if we're in a binary data block. For some tags — looking at you, Composite tags — there literally is no ID, so you get an empty string back. And if you call it in list context, it also hands you a language code for the tag, but only if one exists and it's different from the default language (like when XMP lang-alt tags have alternate language entries, iykyk).

$id = $exifTool->GetTagID($tag);
($id, $lang) = $exifTool->GetTagID($tag);

Inputs:

  • 0) ExifTool object reference
  • 1) Tag key

Return Values:

In scalar context, you get the tag ID, or '' if this tag has no ID at all. In list context, you get the tag ID (or '') and the language code (or undef). ✨


🦋 GetDescription 🦋

Gets you the description for whatever tag you point at. This one is a guaranteed defined value situation — it will always return something. If a description doesn't actually exist? No worries bestie, one gets generated from the tag name. Slay.

Inputs:

  • 0) ExifTool object reference
  • 1) Tag key

Return Values:

A description for the specified tag. 💅


🌸 GetGroup 🌸

Gets you the group name(s) for a tag. Here's the whole vibe:

# return family 0 group name (eg. 'EXIF');
$group = $exifTool->GetGroup($tag, 0);

# return all groups (eg. qw{EXIF IFD0 Author Main})
@groups = $exifTool->GetGroup($tag);

# return groups as a string (eg. 'Main:IFD0:Author')
$group = $exifTool->GetGroup($tag, ':3:1:2');

# return groups as a simplified string (eg. 'IFD0:Author')
$group = $exifTool->GetGroup($tag, '3:1:2');

Inputs:

  • 0) ExifTool object reference
  • 1) Tag key
  • 2) [optional] Group family number, or string of numbers separated by colons

Return Values:

The group name (or '' if the tag has no group, tragic). If you don't specify a group family, GetGroup gives you the name of the group in family 0 when called in scalar context, or the names of groups for all families when called in list context. If your input group family contains a colon, you get back a string of group names separated by colons. That string gets simplified — it strips a leading 'Main:' and any adjacent identical group names — unless the family string begins with a colon. Periodt.

Notes:

The group family numbers you can currently use:

  • 0) Information Type (eg. EXIF, XMP, IPTC)
  • 1) Specific Location (eg. IFD0, ExifIFD, XMP-dc)
  • 2) Category (eg. Author, Time)
  • 3) Document Number (eg. Main, Doc1, Doc3-2)
  • 4) Instance Number (eg. Copy1, Copy2, Copy3)
  • 5) Metadata Path (eg. JPEG-APP1-IFD0-ExifIFD)
  • 6) EXIF/TIFF Format (eg. int8u, int32u, undef, string)
  • 7) Tag ID (eg. ID-271, ID-rights, ID-a9aut)
  • 8) Alternate File Number (eg. File1, File2, File3)

Families 0 and 1 are both based on the file structure, and they're similar — except family 1 is more specific and sub-divides some groups so you get more detail about exactly where the info was found. For example: the EXIF group gets split up based on the specific IFD (Image File Directory), the MakerNotes group gets divided into groups per manufacturer, and the XMP group gets separated based on the XMP namespace prefix. Quick note: only the common XMP namespaces are listed in the GetAllGroups documentation, but additional namespaces may show up in some XMP data. Also, those 'XMP-xmp...' group names may appear in the older form 'XMP-xap...' since these names evolved as the XMP standard was developed. And the ICC_Profile group is broken down to give info about the specific ICC_Profile tag that multiple values were extracted from — plus info pulled from the ICC_Profile header gets separated into the ICC-header group. 🔥

Family 2 classifies information based on the logical category that the information refers to.

Family 3 gives the document number for tags extracted from embedded documents, or 'Main' for tags from the main document. (Peep the ExtractEmbedded option for extracting tags from embedded documents.) Nested sub-documents, if they exist, are indicated by numbers separated with dashes in the group name, to an arbitrary depth. (eg. 'Doc2-3-1' is the 1st sub-sub-document of the 3rd sub-document of the 2nd embedded document of the main file.) Document numbers are also used to differentiate samples for timed metadata in videos. 🎀

Family 4 gives you a way to tell tags apart when multiple tags exist with the same name in the same location. The primary instance of a tag — that's the one extracted when the Duplicates option is disabled and no group is specified — has no family 4 group name. But additional instances get family 4 group names of 'Copy1', 'Copy2', 'Copy3', etc. And for convenience? The primary tag can also be accessed using a group name of 'Copy0'. Cute.

Family 5 is experimental, and gives the complete path for the metadata in the file. Only generated if the SavePath option is used when extracting.

Family 6 is currently used only for EXIF/TIFF metadata, and gives the format type of the extracted value. Only generated if the SaveFormat option is used when extracting.

Family 7 is for tag ID's. The group names are the actual tag ID's, with a leading "ID-" string. Non-numerical ID's have characters other than [-_A-Za-z0-9] converted to hex. Numerical tag ID's are returned in hex if the HexTagIDs option is set, otherwise decimal is used. When you're specifying a family 7 group name, numerical ID's may be in hex or decimal, and non-numerical ID's may or may not have characters other than [-_A-Za-z0-9] converted to hex. Heads up tho: unlike other group names, the tag ID's of family 7 group names are case sensitive (but the leading "ID-" is not). 💀

Family 8 specifies the alternate file set from a call to SetAlternateFile.

See "GetAllGroups [static]" for complete lists of group names.


🌈 GetGroups 🌈

Gets you the list of group names that exist in the specified information.

@groups = $exifTool->GetGroups($info, 2);
@groups = $exifTool->GetGroups('3:1');

Inputs:

  • 0) ExifTool object reference
  • 1) [optional] Info hash ref (default is all extracted info)
  • 2) [optional] Group family number, or string of numbers (default 0)

Return Values:

A list of group names in alphabetical order. If the information hash isn't specified, the group names come back for all extracted information. See "GetGroup" for a description of family numbers and family number strings. 🫶


⭐ BuildCompositeTags ⭐

Builds composite tags from required tags. Composite tags are those lil convenience tags that get derived from the values of other tags. This routine gets called automatically by "ImageInfo" and "ExtractInfo" if the Composite option is set. No cap.

Inputs:

  • 0) ExifTool object reference

Return Values:

(none)

Notes:

Tag values get 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, and for those, "BuildCompositeTags" must be called while the image is still available. This is only a problem if "ImageInfo" is called with a filename (as opposed to a file reference or scalar reference) — because in that case, the file is closed before "ImageInfo" returns. So here's the move: use the Composite option so that "BuildCompositeTags" gets called from within "ImageInfo", before the file gets closed. 💅


👑 AvailableOptions [static] 👑

Get a list of available API options. (See "Options" for the option details.)

Inputs:

(none)

Return Values:

A reference to a list of available options. Each entry in the list is a list reference with 4 items: 0=Option name, 1=Default value, 2=Description, 3=flag set if the option is undocumented.

my $opts = Image::ExifTool::<b>AvailableOptions</b>();
foreach (@$opts) {
    my ($optionName, $defaultValue, $description) = @$_;
    ...
}

🧚 GetTagName [static] 🧚

Get the name of a tag from a tag key. This is a convenience function that strips the embedded instance number — if one exists — from the tag key.

Note: "static" in the heading above means the function doesn't need an ExifTool object reference as its first argument. Every function documented below this point is also static. 💜
$tagName = Image::ExifTool::GetTagName($tag);

Inputs:

  • 0) Tag key

Return Value:

The tag name. This is the same as the tag key but with the instance number removed.


🍓 GetShortcuts [static] 🍓

Get a list of shortcut tags.

Inputs:

(none)

Return Values:

A list of shortcut tags (as defined in Image::ExifTool::Shortcuts).


✨ GetAllTags [static] ✨

Get a list of all available tag names.

@tagList = Image::ExifTool::GetAllTags($group);

Inputs:

  • 0) [optional] Group name, or string of group names separated by colons

Return Values:

A list of all available tags in alphabetical order — or all tags in a specified group, or in the intersection of groups. The group name is case insensitive, and any group in families 0-2 may be used except for EXIF family 1 groups (ie. the specific IFD).


💖 GetWritableTags [static] 💖

Get a list of all writable tag names.

@tagList = Image::ExifTool::GetWritableTags($group);

Inputs:

  • 0) [optional] Group name, or string of group names separated by colons

Return Values:

A list of all writable tags in alphabetical order. These are the tags whose values you can actually set through "SetNewValue". If you pass a group name, you only get the writable tags in the specified group(s). The group name is case insensitive, and any group in families 0-2 may be used except for EXIF family 1 groups (ie. the specific IFD).


🌸 GetAllGroups [static] 🌸

Get a list of all group names in a specified family.

@groupList = Image::ExifTool::GetAllGroups($family);

Inputs:

  • 0) Group family number (0-7)

Return Values:

A list of all groups in the specified family, in alphabetical order.

Here is a complete list of groups for each of these families:

Family 0 (Information Type)

okay so this is the big one bestie, the family that tells you what kind of info a group is holding 💖 here's the whole roster:

AAC, AFCP, AIFF, APE, APP0, APP1, APP10, APP11, APP12, APP13, APP14,
APP15, APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, ASF, Audible,
Canon, CanonVRD, Composite, DICOM, DjVu, DNG, Ducky, DV, EXE, EXIF,
ExifTool, File, FITS, FLAC, Flash, FlashPix, FLIR, Font,
FotoStation, GeoTiff, GIF, GIMP, GM, GoPro, H264, HTML, ICC_Profile,
ID3, IPTC, ISO, ITC, JFIF, JPEG, Jpeg2000, JSON, JUMBF, Kandao,
Leaf, LNK, Lytro, M2TS, MakerNotes, Matroska, Meta, MIE, MIFF, MISB,
MNG, MOI, MPC, MPEG, MPF, MXF, Ogg, OpenEXR, Opus, Palm,
PanasonicRaw, Parrot, PDF, PhotoCD, PhotoMechanic, Photoshop, PICT,
PLIST, PNG, PostScript, PrintIM, Protobuf, PSP, QuickTime, Radiance,
RAF, Rawzor, Real, Red, RIFF, RSRC, RTF, SigmaRaw, Sony, Stim, SVG,
Theora, Torrent, Trailer, VCard, Vorbis, WTV, XML, XMP, ZIP

like, the entire squad fr fr 🫶

Family 1 (Specific Location)

and this family is the glow-up: it tells you exactly where the tag is chillin' at, down to the specific location 🎀

AAC, AC3, Adobe, AdobeCM, AdobeDNG, AFCP, AIFF, APE, APP2, Apple,
AROT, ASF, Audible, AudioItemList, AudioKeys, AudioUserData, AVI1,
CameraIFD, Canon, CanonCustom, CanonDR4, CanonRaw, CanonVRD, Casio,
CBOR, Chapter#, CIFF, Composite, DICOM, DJI, DjVu, DjVu-Meta, DNG,
Ducky, DV, EPPIM, EXE, EXIF, ExifIFD, ExifTool, File, FITS, FLAC,
Flash, FlashPix, FLIR, Font, FotoStation, FujiFilm, FujiIFD, Garmin,
GE, GeoTiff, GIF, GIMP, GlobParamIFD, GM, Google, GoPro, GPS,
GraphConv, GSpherical, H264, HP, HTC, HTML, HTML-dc, HTML-ncc,
HTML-office, HTML-prod, HTML-vw96, HTTP-equiv, ICC-chrm, ICC-cicp,
ICC-clrt, ICC-header, ICC-meas, ICC-meta, ICC-view, ICC_Profile,
ICC_Profile#, ID3, ID3v1, ID3v1_Enh, ID3v2_2, ID3v2_3, ID3v2_4,
IFD0, IFD1, InfiRay, Insta360, InteropIFD, IPTC, IPTC#, ISO, ITC,
ItemList, iTunes, JFIF, JFXX, JPEG, JPEG-HDR, Jpeg2000, JPS, JSON,
JUMBF, JVC, KDC_IFD, Keys, KFIX, Kodak, KodakBordersIFD,
KodakEffectsIFD, KodakIFD, KSTB, KVAR, KyoceraRaw, Leaf, LeafSubIFD,
Leica, LNK, Lyrics3, Lytro, M-RAW, M2TS, MAC, MacOS, MakerNotes,
MakerUnknown, Matroska, MediaJukebox, Meta, MetaIFD, Microsoft,
MIE-Audio, MIE-Camera, MIE-Canon, MIE-Doc, MIE-Extender, MIE-Flash,
MIE-Geo, MIE-GPS, MIE-Image, MIE-Lens, MIE-Main, MIE-MakerNotes,
MIE-Meta, MIE-Orient, MIE-Preview, MIE-Thumbnail, MIE-Unknown,
MIE-UTM, MIE-Video, MIFF, Minolta, MinoltaRaw, MISB, MNG, MOBI, MOI,
Motorola, MPC, MPEG, MPF0, MPImage, MS-DOC, MXF, Nextbase, Nikon,
NikonCapture, NikonCustom, NikonScan, NikonSettings, NineEdits,
Nintendo, NITF, Ocad, Ogg, Olympus, OnePlus, OpenEXR, Opus, Palm,
Panasonic, PanasonicRaw, Parrot, PDF, Pentax, PhaseOne, PhotoCD,
PhotoMechanic, Photoshop, PICT, PictureInfo, PNG, PNG-cICP,
PNG-pHYs, PostScript, PreviewIFD, PrintIM, ProfileIFD, PSP,
Qualcomm, QuickTime, Radiance, RAF, RAF2, Rawzor, Real, Real-CONT,
Real-MDPR, Real-PROP, Real-RA3, Real-RA4, Real-RA5, Real-RJMD,
Reconyx, Red, Ricoh, RIFF, RMETA, RSRC, RTF, Samsung, Sanyo,
Scalado, SEAL, Sigma, SigmaRaw, Sony, SonyIDC, SPIFF, SR2,
SR2DataIFD, SR2SubIFD, SRF#, Stim, SubIFD, SVG, System, Theora,
Torrent, Track#, Track#ItemList, Track#Keys, Track#UserData,
UserData, VCalendar, VCard, Version0, VideoItemList, VideoKeys,
VideoUserData, Vivo, VNote, Vorbis, WTV, XML, XMP, XMP-aas,
XMP-acdsee, XMP-acdsee-rs, XMP-album, XMP-apdi, XMP-apple-fi,
XMP-ast, XMP-aux, XMP-cc, XMP-cell, XMP-crd, XMP-creatorAtom,
XMP-crs, XMP-dc, XMP-Device, XMP-dex, XMP-DICOM, XMP-digiKam,
XMP-drone-dji, XMP-dwc, XMP-et, XMP-exif, XMP-exifEX,
XMP-expressionmedia, XMP-extensis, XMP-fpv, XMP-GAudio, XMP-GCamera,
XMP-GContainer, XMP-GCreations, XMP-GDepth, XMP-getty, XMP-GFocus,
XMP-GImage, XMP-GPano, XMP-GSpherical, XMP-hdr, XMP-HDRGainMap,
XMP-hdrgm, XMP-ics, XMP-iptcCore, XMP-iptcExt, XMP-LImage, XMP-lr,
XMP-mediapro, XMP-microsoft, XMP-MP, XMP-MP1, XMP-mwg-coll,
XMP-mwg-kw, XMP-mwg-rs, XMP-nine, XMP-panorama, XMP-pdf, XMP-pdfx,
XMP-photomech, XMP-photoshop, XMP-PixelLive, XMP-plus, XMP-pmi,
XMP-prism, XMP-prl, XMP-prm, XMP-pur, XMP-rdf, XMP-sdc, XMP-seal,
XMP-swf, XMP-tiff, XMP-x, XMP-xmp, XMP-xmpBJ, XMP-xmpDM, XMP-xmpDSA,
XMP-xmpMM, XMP-xmpNote, XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg, ZIP

not me listing all of those 💀 iconic behaviour, honestly.

Family 2 (Category)

the vibes-only family — just the category, keepin' it simple:

Audio, Author, Camera, Device, Document, ExifTool, Image, Location,
Other, Preview, Printing, Time, Unknown, Video

Family 3 (Document Number)

which document we talkin' bout? 👑

Doc#, Main

Family 4 (Instance Number)

how many copies, bestie:

Copy#

Family 5 (Metadata Path)

the whole journey, mapped out, like a lil travel itinerary for your tag 🦋

eg. JPEG-APP1-IFD0-ExifIFD

Family 6 (EXIF/TIFF Format)

the data-type girlies ✨

int8u, string, int16u, int32u, rational64u, int8s, undef, int16s,
int32s, rational64s, float, double, ifd, unicode, complex, int64u,
int64s, ifd64

Family 7 (Tag ID)

the actual ID, no cap:

ID-xxx (where xxx is the tag ID. Numerical ID's are returned in hex with a leading "0x" if the HexTagIDs option is set, or decimal otherwise. Characters in non-numerical ID's which are not valid in a group name are returned as 2 hex digits.)

Family 8 (Alternate File)

the backup-bestie situation:

File#
heads up!! ⚠️ this function may also be called as an ExifTool member function, so you can set the HexTagIDs option while you're pulling family 7 group names. iykyk 💅

GetDeleteGroups [static] 🗑️✨

grab the list of every deletable group name, bestie. spring cleaning energy.

@delGroups = Image::ExifTool::GetDeleteGroups();

Inputs:

  • None. that's it. nothing. nada. 🎀

Return Values:

a list of deletable group names, all alphabetical and cute. the current list of deletable group names is:

Adobe, AFCP, APP0, APP1, APP10, APP11, APP12, APP13, APP14, APP15,
APP2, APP3, APP4, APP5, APP6, APP7, APP8, APP9, Audio, Author,
Camera, CanonVRD, CIFF, Document, Ducky, EXIF, ExifIFD, ExifTool,
File, FlashPix, FotoStation, GlobParamIFD, GPS, ICC_Profile, IFD0,
IFD1, Image, Insta360, InteropIFD, IPTC, ItemList, JFIF, Jpeg2000,
Keys, Location, MakerNotes, Meta, MetaIFD, Microsoft, MIE, MPF,
NikonCapture, Other, PDF, PDF-update, PhotoMechanic, Photoshop, PNG,
PNG-pHYs, Preview, PrintIM, Printing, QuickTime, RMETA, RSRC,
SubIFD, Time, Trailer, UserData, Video, XML, XML-*, XMP, XMP-*

so to schedule a group for deletion, you call SetNewValue with a tag name like 'EXIF:*' and an undefined tag value. slay.

deleting a family 0 or 1 group will delete the entire corresponding block of metadata — like, the whole thing, gone. but deleting a family 2 group (eg. Audio, Author, Camera, etc.) just deletes the individual tags that belong to that category. lowkey different vibes.

the 'Trailer' group lets you delete all trailers in JPEG and TIFF-format images at once, including the unknown ones. 👀

important!! the JPEG "APP" groups are special — they're only used to delete application segments that aren't associated with another deletable group. for example, deleting 'APP14:*' will delete other APP14 segments, but not the APP14 "Adobe" segment. don't get it twisted bestie 💅

GetFileType [static] 🔍

get the type of a file from its file name. detective mode activated.

my $type = Image::ExifTool::GetFileType($filename);
my $desc = Image::ExifTool::GetFileType($filename, 1);

Inputs:

  • 0) [optional] file name (or just an extension)
  • 1) [optional] flag to return a description instead of a type. default is undef. set it to 0 to also return types of recognized but unsupported files (otherwise the return value for unsupported files is undef), or set it to 1 to return descriptions.

Return Value:

a string, based on the file extension, that indicates the basic format of the file. 🦋

quick note: some files may be based on other formats (like, so many RAW image formats are lowkey based on TIFF). in list context, it may return more than one file type if the file could be based on different formats. it returns undef if files with this extension aren't supported by ExifTool yet. 😭 if you don't give it an input extension at all, it returns a list of extensions for all supported file types (or all recognized file types if the description flag is set to 0). and when the description flag is set, you get a much more detailed description of the specific file format. periodt.

CanWrite [static] ✍️

can the specified file be written to, or nah?

my $writable = Image::ExifTool::CanWrite($filename);

Inputs:

  • 0) file name or extension

Return Value:

true if ExifTool supports writing files of this type (based on the file extension). 💖


CanCreate [static] 🎨

can the specified file be created from scratch?

my $creatable = Image::ExifTool::CanCreate($filename);

Inputs:

  • 0) file name or extension

Return Value:

true if ExifTool can create files with this extension from scratch. currently, this can only be done with XMP, MIE, ICC, VRD, DR4, EXV and EXIF files. that's the whole list, bestie, no more no less 👑


AddUserDefinedTags [static] 🌈

add user-defined tags to an existing tag table at run time. main character energy fr.

this differs from the usual technique of creating user-defined tags via the %Image::ExifTool::UserDefined hash (see the ExifTool_config file in the Image::ExifTool distribution) because it lets you add tags after a tag table has already been initialized. so you're not stuck with the setup you started with. 💅

use Image::ExifTool ':Public';
my %tags = (
    TestTagID1 => { Name => 'TestTagName1' },
    TestTagID2 => { Name => 'TestTagName2' },
);
my $num = AddUserDefinedTags('Image::ExifTool::PDF::Info', %tags);

Inputs:

  • 0) destination tag table name
  • 1-N) pairs of tag ID / tag information hash references for the new tags

Return Value:

the number of tags added. slay.

Notes

pre-existing tags with the same ID will be replaced in the destination table. 🙈 see lib/Image/ExifTool/README in the full distribution for full details on the elements of the tag information hash.


OrderedKeys [static] 🔑

return a list of ordered keys from a tag value that's a HASH reference when the Struct option is used. organised queen behaviour.

use Image::ExifTool ':Public';
my @keys = OrderedKeys($structRef);

Inputs:

  • 0) structure HASH reference

Return Value:

list of ordered keys — or sorted alphabetically if they're not ordered. either way you're gettin' a list, bestie 🎀

💖 CHARACTER ENCODINGS 💖

Okay so bestie, plot twist: not every meta info format is out here living that plain ASCII life. Some of them are multilingual icons ✨. When ExifTool reads, most known encodings get converted to the external character set — whatever you set in the Charset option — or to UTF-8 if you didn't say anything. When it writes, it does the whole thing in reverse. And if you'd rather vibe with HTML character entities instead, there's the Escape HTML option for flipping special characters to/from those.

There are two character sets in this story and you gotta keep them straight:

  • the external character set — the one you actually see through the ExifTool API
  • the internal character set — the one used to stash text inside a file's metadata

They can be specified totally separately, like this:


🌸 External Character Sets 🌸

The encoding for tag values going to/from ExifTool API functions is set with the Charset option, which is 'UTF8' by default. Periodt.

File names get their own treatment via the CharsetFileName option. By default CharsetFileName is not defined, and file names handed to ExifTool go straight into the system i/o routines — which are expecting UTF-8 strings on Mac/Linux, but default to the system code page on Windows. In this mode on Windows, you get a warning if a file name contains special characters 😬, but you can dodge that warning by setting CharsetFileName to an empty string. Setting CharsetFileName to literally any other value makes file names get converted from the encoding you specified to one that's appropriate for the system. On Windows this also activates Unicode filename support via the special Windows wide-character i/o routines — but only if Win32API::File is available.

Heads up bestie: setting the WindowsWideFile or WindowsLongPath option makes CharsetFileName default to 'UTF8' in Windows if it isn't already defined, and WindowsLongPath is set by default in ExifTool 13.07 and later. 👑

🦋 Internal Character Sets 🦋

These are the encodings used to store strings in the various metadata formats. You can change them for certain types of metadata with the CharsetEXIF, CharsetID3, CharsetIPTC, CharsetPhotoshop, CharsetQuickTime and CharsetRIFF options.

Values come back as byte strings of encoded characters. Perl wide characters are not used. By default, most returned strings are encoded in UTF-8, and for those you can use Encode::decode_utf8() to convert to a sequence of logical Perl characters. Also — and this is the sneaky part — some settings of the PERL_UNICODE environment variable may be incompatible with ExifTool's character handling. 🙈

More specific deets below about how character coding is handled for EXIF, IPTC, XMP, PNG, ID3, PDF, Photoshop, QuickTime, AIFF, MIE and Vorbis:


📸 EXIF 📸

Most textual info in EXIF is stored in ASCII format (called "string" in the ExifTool tag name documentation, iykyk). By default ExifTool does not convert these strings. But it's honestly not uncommon for applications to write UTF-8 or other encodings where ASCII is expected 😭, and to deal with those, ExifTool lets you specify the internal EXIF string encoding with CharsetEXIF — which makes EXIF string values get converted from the specified character set when reading, and stored with this character set when writing. (The MWG recommends using UTF-8 encoding for EXIF strings, and in keeping with this the MWG module sets the default internal EXIF string encoding to UTF-8, but note that this will have no effect unless the external encoding is also set to something other than the default of UTF-8. 💀)

A few EXIF tags — UserComment, GPSProcessingMethod and GPSAreaInformation — support a designated internal text encoding, with values stored as ASCII, Unicode (UCS-2) or JIS. When reading these tags, ExifTool converts Unicode and JIS to the external character set specified by the Charset option, or to UTF-8 by default. ASCII text is not converted. When writing, text is stored as ASCII unless the string contains special characters, in which case it's converted from the external character set (UTF-8 by default) and stored as Unicode. ExifTool writes Unicode in native EXIF byte ordering by default, but you can specify the byte order by setting the ExifUnicodeByteOrder tag (see the Extra Tags documentation).

The EXIF "XP" tags (XPTitle, XPComment, etc) are always stored as little-endian Unicode (UCS-2), and are read and written using the specified character set.


📰 IPTC 📰

The value of the IPTC:CodedCharacterSet tag is the main character deciding how internal IPTC string values get interpreted. If CodedCharacterSet exists and has a value of 'UTF8' (or 'ESC % G'), then string values are assumed to be stored as UTF-8. Otherwise Windows Latin1 (cp1252, 'Latin') coding is assumed by default — but you can change that with the CharsetIPTC option. When reading, these strings get converted to the character set specified by the Charset option. When writing, the inverse conversions happen. And if the internal (IPTC) and external (ExifTool) character sets are the same, no conversion is done at all.

Bestie, real talk: ISO 2022 character set shifting is not supported. Instead, a warning is issued and the string is not converted if an ISO 2022 shift code is encountered. 🚨

See http://www.iptc.org/IIM/ for the official IPTC specification.

You can also use ExifTool to convert IPTC values to a different internal encoding — to do that, all IPTC tags must be rewritten along with the desired value of CodedCharacterSet. For example, this command changes the internal IPTC encoding to UTF-8 (from Windows Latin1 unless CodedCharacterSet was already 'UTF8'):

exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 a.jpg

or from Windows Latin2 (cp1250) to UTF-8:

exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 \
-charset iptc=latin2 a.jpg

and this command changes it back from UTF-8 to Windows Latin1 (cp1252):

exiftool -tagsfromfile @ -iptc:all -codedcharacterset= a.jpg

or to Windows Latin2:

exiftool -tagsfromfile @ -iptc:all -codedcharacterset= \
-charset iptc=latin2 a.jpg

Unless CodedCharacterSet is 'UTF8', applications have no reliable way to determine the IPTC character encoding. For this reason, it's recommended that CodedCharacterSet be set to 'UTF8' when creating new IPTC. 🌈

(Note: Here, "IPTC" refers to the older IPTC IIM format. The more recent IPTC Core and Extension specifications actually use the XMP format.)


✨ XMP ✨

ExifTool reads XMP encoded as UTF-8, UTF-16 or UTF-32, and converts them all to UTF-8 internally. Also, all XML character entity references and numeric character references get converted. When writing, ExifTool always encodes XMP as UTF-8, converting the following 5 characters to XML character references: & < > ' ". By default no further conversion is performed — however, if the Charset option is other than 'UTF8', then text is converted to/from the specified character set when reading/writing.


🎀 PNG 🎀

PNG TextualData tags are stored as tEXt, zTXt and iTXt chunks in PNG images. The tEXt and zTXt chunks use ISO 8859-1 encoding, while iTXt uses UTF-8. When reading, ExifTool converts all PNG textual data to the character set specified by the Charset option. When writing, ExifTool generates a tEXt chunk (or zTXt with the Compress option) if the text doesn't contain special characters or if Latin encoding is specified — otherwise an iTXt chunk is used and the text is converted from the specified character set and stored as UTF-8.


🖼️ JPEG Comment 🖼️

The encoding for the JPEG Comment (COM segment) is not specified, so ExifTool reads/writes this text without conversion. It's giving chaos, but that's just how it is. 🤷


🎵 ID3 🎵

The ID3v1 specification officially supports only ISO 8859-1 encoding (a subset of Windows Latin1), although some applications may incorrectly use other character sets 🙈. By default ExifTool converts ID3v1 text from Latin to the character set specified by the Charset option. However, the internal ID3v1 charset may be specified with the CharsetID3 option. The encoding for ID3v2 information is stored in the file, so ExifTool converts ID3v2 text from this encoding to the character set specified by the Charset option. ExifTool does not currently write ID3 information.


📄 PDF 📄

PDF text strings are stored in either PDFDocEncoding (similar to Windows Latin1) or Unicode (UCS-2). When reading, ExifTool converts to the character set specified by the Charset option. When writing, ExifTool encodes input text from the specified character set as Unicode only if the string contains special characters — otherwise PDFDocEncoding is used.


🧚 Photoshop 🧚

Some Photoshop resource names are stored as Pascal strings with unknown encoding. By default, ExifTool assumes MacRoman encoding and converts this to UTF-8, but the internal and external character sets may be specified with the CharsetPhotoshop and Charset options respectively.


🎬 QuickTime 🎬

QuickTime text strings may be stored in a variety of poorly documented formats. ExifTool does its best to decode these according to the Charset option setting. For some QuickTime strings, ExifTool assumes a default encoding of MacRoman, but this may be changed with the CharsetQuickTime option.


🔊 AIFF 🔊

AIFF strings are assumed to be stored in MacRoman, and are converted according to the Charset option when reading.


🎧 RIFF 🎧

The internal encoding of RIFF strings (eg. in AVI and WAV files) is assumed to be Latin unless otherwise specified by the RIFF CSET chunk or the CharsetRIFF option.


🍓 MIE 🍓

MIE strings are stored as either UTF-8 or ISO 8859-1. When reading, UTF-8 strings are converted according to the Charset option, and ISO 8859-1 strings are never converted. When writing, input strings are converted from the specified character set to UTF-8. The resulting strings are stored as UTF-8 if they contain multi-byte UTF-8 character sequences, otherwise they're stored as ISO 8859-1.


🌟 Vorbis 🌟

Vorbis comments are stored as UTF-8, and are converted to the character set specified by the Charset option.


👑 AUTHOR 👑

Copyright 2003-2026, Phil Harvey

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


🫶 ACKNOWLEDGEMENTS 🫶

Many people have helped in the development of ExifTool through their bug reports, comments and suggestions, and/or additions to the code. See the ACKNOWLEDGEMENTS in the individual Image::ExifTool modules and in html/index.html of the Image::ExifTool distribution package for a list of people who have contributed to this project. Not me getting emotional over the community. 😭💖


🔥 SEE ALSO 🔥


And that's a wrap on the whole page bestie, we ate and left zero crumbs 💅✨ This iconic little doc is living under perl v5.42.1 and it's dated 2026-03-31 — Image::ExifTool(3), no cap. Go forth and read them tags. 🦋💜

📦 where this page comes from