exiftool (Image-ExifTool-12.57) | : | exiftool (Image-ExifTool-12.58) | ||
---|---|---|---|---|
skipping to change at line 14 | skipping to change at line 14 | |||
# | # | |||
# Description: Read/write meta information | # Description: Read/write meta information | |||
# | # | |||
# Revisions: Nov. 12/03 - P. Harvey Created | # Revisions: Nov. 12/03 - P. Harvey Created | |||
# (See html/history.html for revision history) | # (See html/history.html for revision history) | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
use strict; | use strict; | |||
use warnings; | use warnings; | |||
require 5.004; | require 5.004; | |||
my $version = '12.57'; | my $version = '12.58'; | |||
# add our 'lib' directory to the include list BEFORE 'use Image::ExifTool' | # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool' | |||
BEGIN { | BEGIN { | |||
# (undocumented -xpath option added in 11.91, must come before other options ) | # (undocumented -xpath option added in 11.91, must come before other options ) | |||
my $exePath = @ARGV && lc($ARGV[0]) eq '-xpath' && shift() ? $^X : $0; | my $exePath = @ARGV && lc($ARGV[0]) eq '-xpath' && shift() ? $^X : $0; | |||
# get exe directory | # get exe directory | |||
my $exeDir = ($exePath =~ /(.*)[\\\/]/) ? $1 : '.'; | my $exeDir = ($exePath =~ /(.*)[\\\/]/) ? $1 : '.'; | |||
my $incDir = ($0 =~ /(.*)[\\\/]/) ? "$1/lib" : './lib'; | my $incDir = ($0 =~ /(.*)[\\\/]/) ? "$1/lib" : './lib'; | |||
if (-l $0) { | if (-l $0) { | |||
my $lnk = eval { readlink $0 }; | my $lnk = eval { readlink $0 }; | |||
skipping to change at line 258 | skipping to change at line 258 | |||
my %optArgs = ( | my %optArgs = ( | |||
'-tagsfromfile' => 1, '-addtagsfromfile' => 1, '-alltagsfromfile' => 1, | '-tagsfromfile' => 1, '-addtagsfromfile' => 1, '-alltagsfromfile' => 1, | |||
'-@' => 1, | '-@' => 1, | |||
'-api' => 1, | '-api' => 1, | |||
'-c' => 1, '-coordformat' => 1, | '-c' => 1, '-coordformat' => 1, | |||
'-charset' => 0, # (optional arg; OK because arg cannot begin with "-") | '-charset' => 0, # (optional arg; OK because arg cannot begin with "-") | |||
'-config' => 1, | '-config' => 1, | |||
'-csvdelim' => 1, | '-csvdelim' => 1, | |||
'-d' => 1, '-dateformat' => 1, | '-d' => 1, '-dateformat' => 1, | |||
'-D' => 0, # necessary to avoid matching lower-case equivalent | '-D' => 0, # necessary to avoid matching lower-case equivalent | |||
'-echo' => 1, '-echo1' => 1, '-echo2' => 1, '-echo3' => 1, '-echo4' => 1, | '-echo' => 1, '-echo#' => 1, | |||
'-efile' => 1, '-efile1' => 1, '-efile2' => 1, '-efile3' => 1, '-efile4' => | '-efile' => 1, '-efile#' => 1, '-efile!' => 1, '-efile#!' => 1, | |||
1, | ||||
'-efile!' => 1, '-efile1!' => 1, '-efile2!' => 1, '-efile3!' => 1, '-efile4! | ||||
' => 1, | ||||
'-ext' => 1, '--ext' => 1, '-ext+' => 1, '--ext+' => 1, | '-ext' => 1, '--ext' => 1, '-ext+' => 1, '--ext+' => 1, | |||
'-extension' => 1, '--extension' => 1, '-extension+' => 1, '--extension+ ' => 1, | '-extension' => 1, '--extension' => 1, '-extension+' => 1, '--extension+ ' => 1, | |||
'-fileorder' => 1, '-fileorder0' => 1, '-fileorder1' => 1, '-fileorder2' => | '-fileorder' => 1, '-fileorder#' => 1, | |||
1, | ||||
'-fileorder3' => 1, '-fileorder4' => 1, '-fileorder5' => 1, | ||||
'-geotag' => 1, | '-geotag' => 1, | |||
'-globaltimeshift' => 1, | '-globaltimeshift' => 1, | |||
'-i' => 1, '-ignore' => 1, | '-i' => 1, '-ignore' => 1, | |||
'-if' => 1, '-if0' => 1, '-if1' => 1, '-if2' => 1, '-if3' => 1, '-if4' => 1, '-if5' => 1, | '-if' => 1, '-if#' => 1, | |||
'-lang' => 0, # (optional arg; cannot begin with "-") | '-lang' => 0, # (optional arg; cannot begin with "-") | |||
'-listitem' => 1, | '-listitem' => 1, | |||
'-o' => 1, '-out' => 1, | '-o' => 1, '-out' => 1, | |||
'-p' => 1, '-printformat' => 1, | '-p' => 1, '-printformat' => 1, | |||
'-P' => 0, | '-P' => 0, | |||
'-password' => 1, | '-password' => 1, | |||
'-require' => 1, | '-require' => 1, | |||
'-sep' => 1, '-separator' => 1, | '-sep' => 1, '-separator' => 1, | |||
'-srcfile' => 1, | '-srcfile' => 1, | |||
'-stay_open' => 1, | '-stay_open' => 1, | |||
skipping to change at line 4194 | skipping to change at line 4192 | |||
$filename .= substr($fmt, $pos); # add rest of file name | $filename .= substr($fmt, $pos); # add rest of file name | |||
# return now with filename unless file exists | # return now with filename unless file exists | |||
return $filename unless ($mt->Exists($filename) and not defined $usedFil eName{$filename}) or $usedFileName{$filename}; | return $filename unless ($mt->Exists($filename) and not defined $usedFil eName{$filename}) or $usedFileName{$filename}; | |||
if (defined $okfile) { | if (defined $okfile) { | |||
return $filename if $filename eq $okfile; | return $filename if $filename eq $okfile; | |||
my ($fn, $ok) = (AbsPath($filename), AbsPath($okfile)); | my ($fn, $ok) = (AbsPath($filename), AbsPath($okfile)); | |||
return $okfile if defined $fn and defined $ok and $fn eq $ok; | return $okfile if defined $fn and defined $ok and $fn eq $ok; | |||
} | } | |||
++$copy; | ++$copy; | |||
++$alpha; | ++$alpha; | |||
++$seq; | ||||
} | } | |||
} | } | |||
#------------------------------------------------------------------------------ | #------------------------------------------------------------------------------ | |||
# Create directory for specified file | # Create directory for specified file | |||
# Inputs: 0) complete file name including path | # Inputs: 0) complete file name including path | |||
# Returns: true if a directory was created | # Returns: true if a directory was created | |||
my $k32CreateDir; | my $k32CreateDir; | |||
sub CreateDirectory($) | sub CreateDirectory($) | |||
{ | { | |||
skipping to change at line 4399 | skipping to change at line 4396 | |||
my $arg = substr($stayOpenBuff, $pos, $len); | my $arg = substr($stayOpenBuff, $pos, $len); | |||
$pos += $len; | $pos += $len; | |||
$arg = FilterArgfileLine($arg); | $arg = FilterArgfileLine($arg); | |||
next unless defined $arg; | next unless defined $arg; | |||
push @newArgs, $arg; | push @newArgs, $arg; | |||
if ($optArgs) { | if ($optArgs) { | |||
# this is an argument for the last option | # this is an argument for the last option | |||
undef $optArgs; | undef $optArgs; | |||
next unless $lastOpt eq '-stay_open' or $lastOpt eq '-@'; | next unless $lastOpt eq '-stay_open' or $lastOpt eq '-@'; | |||
} else { | } else { | |||
$optArgs = $optArgs{$arg}; | ||||
$lastOpt = lc $arg; | $lastOpt = lc $arg; | |||
$optArgs = $optArgs{$lastOpt} unless defined $optArgs; | $optArgs = $optArgs{$arg}; | |||
unless (defined $optArgs) { | ||||
$optArgs = $optArgs{$lastOpt}; | ||||
# handle options with trailing numbers | ||||
$optArgs = $optArgs{"$1#$2"} if not defined $optArgs and | ||||
$lastOpt =~ /^(.*?)\d+(!?)$/; | ||||
} | ||||
next unless $lastOpt =~ /^-execute\d*$/; | next unless $lastOpt =~ /^-execute\d*$/; | |||
} | } | |||
$processArgs = 1; | $processArgs = 1; | |||
last; # process arguments up to this point | last; # process arguments up to this point | |||
} | } | |||
next unless $pos; # nothing to do if we didn't read any arguments | next unless $pos; # nothing to do if we didn't read any arguments | |||
# keep unprocessed data in buffer | # keep unprocessed data in buffer | |||
$stayOpenBuff = substr($stayOpenBuff, $pos); | $stayOpenBuff = substr($stayOpenBuff, $pos); | |||
if ($processArgs) { | if ($processArgs) { | |||
# process new arguments after -execute or -stay_open option | # process new arguments after -execute or -stay_open option | |||
skipping to change at line 4766 | skipping to change at line 4767 | |||
=item B<->I<TAG> | =item B<->I<TAG> | |||
Extract information for the specified tag (eg. C<-CreateDate>). Multiple | Extract information for the specified tag (eg. C<-CreateDate>). Multiple | |||
tags may be specified in a single command. A tag name is the handle by | tags may be specified in a single command. A tag name is the handle by | |||
which a piece of information is referenced. See | which a piece of information is referenced. See | |||
L<Image::ExifTool::TagNames|Image::ExifTool::TagNames> for documentation on | L<Image::ExifTool::TagNames|Image::ExifTool::TagNames> for documentation on | |||
available tag names. A tag name may include leading group names separated | available tag names. A tag name may include leading group names separated | |||
by colons (eg. C<-EXIF:CreateDate>, or C<-Doc1:XMP:Creator>), and each group | by colons (eg. C<-EXIF:CreateDate>, or C<-Doc1:XMP:Creator>), and each group | |||
name may be prefixed by a digit to specify family number (eg. | name may be prefixed by a digit to specify family number (eg. | |||
C<-1IPTC:City>). Use the B<-listg> option to list available group names by | C<-1IPTC:City>). (Note that the API SavePath and SaveFormat options must be | |||
family. | used for the family 5 and 6 groups respectively to be available.) Use the | |||
B<-listg> option to list available group names by family. | ||||
A special tag name of C<All> may be used to indicate all meta information | A special tag name of C<All> may be used to indicate all meta information | |||
(ie. B<-All>). This is particularly useful when a group name is specified | (ie. B<-All>). This is particularly useful when a group name is specified | |||
to extract all information in a group (but beware that unless the B<-a> | to extract all information in a group (but beware that unless the B<-a> | |||
option is also used, some tags in the group may be suppressed by same-named | option is also used, some tags in the group may be suppressed by same-named | |||
tags in other groups). The wildcard characters C<?> and C<*> may be used in | tags in other groups). The wildcard characters C<?> and C<*> may be used in | |||
a tag name to match any single character and zero or more characters | a tag name to match any single character and zero or more characters | |||
respectively. These may not be used in a group name, with the exception that | respectively. These may not be used in a group name, with the exception | |||
a group name of C<*> (or C<All>) may be used to extract all instances of a | that a group name of C<*> (or C<All>) may be used to extract all instances | |||
tag (as if B<-a> was used). Note that arguments containing wildcards must | of a tag (as if B<-a> was used). Note that arguments containing wildcards | |||
be quoted on the command line of most systems to prevent shell globbing. | must be quoted on the command line of most systems to prevent shell | |||
globbing. | ||||
A C<#> may be appended to the tag name to disable the print conversion on a | A C<#> may be appended to the tag name to disable the print conversion on a | |||
per-tag basis (see the B<-n> option). This may also be used when writing or | per-tag basis (see the B<-n> option). This may also be used when writing or | |||
copying tags. | copying tags. | |||
If no tags are specified, all available information is extracted (as if | If no tags are specified, all available information is extracted (as if | |||
C<-All> had been specified). | C<-All> had been specified). | |||
Note: Descriptions, not tag names, are shown by default when extracting | Note: Descriptions, not tag names, are shown by default when extracting | |||
information. Use the B<-s> option to see the tag names instead. | information. Use the B<-s> option to see the tag names instead. | |||
skipping to change at line 4857 | skipping to change at line 4860 | |||
JPEG Image: | JPEG Image: | |||
- Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD, | - Deleting EXIF or IFD0 also deletes ExifIFD, GlobParamIFD, | |||
GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD. | GPS, IFD1, InteropIFD, MakerNotes, PrintIM and SubIFD. | |||
- Deleting ExifIFD also deletes InteropIFD and MakerNotes. | - Deleting ExifIFD also deletes InteropIFD and MakerNotes. | |||
- Deleting Photoshop also deletes IPTC. | - Deleting Photoshop also deletes IPTC. | |||
TIFF Image: | TIFF Image: | |||
- Deleting EXIF only removes ExifIFD which also deletes | - Deleting EXIF only removes ExifIFD which also deletes | |||
InteropIFD and MakerNotes. | InteropIFD and MakerNotes. | |||
MOV/MP4 video: | MOV/MP4 Video: | |||
- Deleting ItemList also deletes Keys tags | - Deleting ItemList also deletes Keys tags. | |||
Notes: | Notes: | |||
1) B<Many tag values may be assigned in a single command>. If two | 1) B<Many tag values may be assigned in a single command>. If two | |||
assignments affect the same tag, the latter takes precedence (except for | assignments affect the same tag, the latter takes precedence (except for | |||
list-type tags, for which both values are written). | list-type tags, for which both values are written). | |||
2) In general, MakerNotes tags are considered "Permanent", and may be edited | 2) In general, MakerNotes tags are considered "Permanent", and may be edited | |||
but not created or deleted individually. This avoids many potential | but not created or deleted individually. This avoids many potential | |||
problems, including the inevitable compatibility problems with OEM software | problems, including the inevitable compatibility problems with OEM software | |||
skipping to change at line 5492 | skipping to change at line 5495 | |||
> exiftool -Orientation#=6 a.jpg | > exiftool -Orientation#=6 a.jpg | |||
=item B<-p> I<FMTFILE> or I<STR> (B<-printFormat>) | =item B<-p> I<FMTFILE> or I<STR> (B<-printFormat>) | |||
Print output in the format specified by the given file or string. The | Print output in the format specified by the given file or string. The | |||
argument is interpreted as a string unless a file of that name exists, in | argument is interpreted as a string unless a file of that name exists, in | |||
which case the string is loaded from the contents of the file. Tag names in | which case the string is loaded from the contents of the file. Tag names in | |||
the format file or string begin with a C<$> symbol and may contain leading | the format file or string begin with a C<$> symbol and may contain leading | |||
group names and/or a trailing C<#> (to disable print conversion). Case is | group names and/or a trailing C<#> (to disable print conversion). Case is | |||
not significant. Braces C<{}> may be used around the tag name to separate | not significant. Braces C<{}> may be used around the tag name to separate | |||
it from subsequent text. Use C<$$> to represent a C<$> symbol, and C<$/> | it from subsequent text (and must be used if subsequent text begins with an | |||
for a newline. | alphanumeric character, hyphen, underline, colon or number sign). Use C<$$> | |||
to represent a C<$> symbol, and C<$/> for a newline. | ||||
Multiple B<-p> options may be used, each contributing a line (or more) of | Multiple B<-p> options may be used, each contributing a line (or more) of | |||
text to the output. Lines beginning with C<#[HEAD]> and C<#[TAIL]> are | text to the output. Lines beginning with C<#[HEAD]> and C<#[TAIL]> are | |||
output before the first processed file and after the last processed file | output before the first processed file and after the last processed file | |||
respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]> are output | respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]> are output | |||
before and after each section of files. A section is defined as a group of | before and after each section of files. A section is defined as a group of | |||
consecutive files with the same section header (eg. files are grouped by | consecutive files with the same section header (eg. files are grouped by | |||
directory if C<#[SECT]> contains C<$directory>). Lines beginning with | directory if C<#[SECT]> contains C<$directory>). Lines beginning with | |||
C<#[BODY]> and lines not beginning with C<#> are output for each processed | C<#[BODY]> and lines not beginning with C<#> are output for each processed | |||
file. Lines beginning with C<#[IF]> are not output, but all BODY lines are | file. Lines beginning with C<#[IF]> are not output, but all BODY lines are | |||
skipping to change at line 5520 | skipping to change at line 5524 | |||
File: $FileName - $DateTimeOriginal | File: $FileName - $DateTimeOriginal | |||
(f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO) | (f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO) | |||
#[TAIL]-- end -- | #[TAIL]-- end -- | |||
with this command: | with this command: | |||
exiftool -p test.fmt a.jpg b.jpg | exiftool -p test.fmt a.jpg b.jpg | |||
produces output like this: | produces output like this: | |||
-- Generated by ExifTool 12.57 -- | -- Generated by ExifTool 12.58 -- | |||
File: a.jpg - 2003:10:31 15:44:19 | File: a.jpg - 2003:10:31 15:44:19 | |||
(f/5.6, 1/60s, ISO 100) | (f/5.6, 1/60s, ISO 100) | |||
File: b.jpg - 2006:05:23 11:57:38 | File: b.jpg - 2006:05:23 11:57:38 | |||
(f/8.0, 1/13s, ISO 100) | (f/8.0, 1/13s, ISO 100) | |||
-- end -- | -- end -- | |||
The values of List-type tags with multiple items and Shortcut tags | The values of List-type tags with multiple items and Shortcut tags | |||
representing multiple tags are joined according the B<-sep> option setting | representing multiple tags are joined according the B<-sep> option setting | |||
when interpolated in the string. | when interpolated in the string. | |||
End of changes. 12 change blocks. | ||||
24 lines changed or deleted | 26 lines changed or added |