diff options
Diffstat (limited to 'exiftool')
-rwxr-xr-x | exiftool | 37 |
1 files changed, 22 insertions, 15 deletions
@@ -11,7 +11,7 @@ use strict; use warnings; require 5.004; -my $version = '12.64'; +my $version = '12.65'; # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool' my $exePath; @@ -814,11 +814,17 @@ for (;;) { /^(-?)(a|duplicates)$/i and $mt->Options(Duplicates => ($1 ? 0 : 1)), next; if ($a eq 'api') { my $opt = shift; - defined $opt or Error("Expected OPT[=VAL] argument for -api option\n"), $badCmd=1, next; - my $val = ($opt =~ s/=(.*)//s) ? $1 : 1; - # empty string means an undefined value unless ^= is used - $val = undef unless $opt =~ s/\^$// or length $val; - $mt->Options($opt => $val); + if (defined $opt and length $opt) { + my $val = ($opt =~ s/=(.*)//s) ? $1 : 1; + # empty string means an undefined value unless ^= is used + $val = undef unless $opt =~ s/\^$// or length $val; + $mt->Options($opt => $val); + } else { + print "Available API Options:\n"; + my $availableOptions = Image::ExifTool::AvailableOptions(); + printf(" %-17s - %s\n", $$_[0], $$_[2]) foreach @$availableOptions; + $helped = 1; + } next; } /^arg(s|format)$/i and $argFormat = 1, next; @@ -2874,7 +2880,7 @@ sub SetImageInfo($$$) } unless ($isStdout) { $outfile = NextUnusedFilename($outfile); - if ($et->Exists($outfile) and not $doSetFileName) { + if ($et->Exists($outfile, 1) and not $doSetFileName) { Warn "Error: '${outfile}' already exists - $infile\n"; EFile($infile); ++$countBadWr; @@ -3005,7 +3011,7 @@ sub SetImageInfo($$$) $outfile = Image::ExifTool::GetNewFileName(defined $outfile ? $outfile : $file, $newDir); } $outfile = NextUnusedFilename($outfile, $infile); - if ($et->Exists($outfile)) { + if ($et->Exists($outfile, 1)) { if ($infile eq $outfile) { undef $outfile; # not changing the file name after all # (allow for case-insensitive filesystems) @@ -4233,7 +4239,7 @@ sub NextUnusedFilename($;$) } $filename .= substr($fmt, $pos); # add rest of file name # return now with filename unless file exists - return $filename unless ($mt->Exists($filename) and not defined $usedFileName{$filename}) or $usedFileName{$filename}; + return $filename unless ($mt->Exists($filename, 1) and not defined $usedFileName{$filename}) or $usedFileName{$filename}; if (defined $okfile) { return $filename if $filename eq $okfile; my ($fn, $ok) = (AbsPath($filename), AbsPath($okfile)); @@ -4313,7 +4319,7 @@ sub OpenOutputFile($;@) $outfile .= $textOut; } my $mode = '>'; - if ($mt->Exists($outfile)) { + if ($mt->Exists($outfile, 1)) { unless ($textOverwrite) { Warn "Output file $outfile already exists for $file\n"; return (); @@ -5576,7 +5582,7 @@ with this command: produces output like this: - -- Generated by ExifTool 12.64 -- + -- Generated by ExifTool 12.65 -- File: a.jpg - 2003:10:31 15:44:19 (f/5.6, 1/60s, ISO 100) File: b.jpg - 2006:05:23 11:57:38 @@ -6516,13 +6522,14 @@ load exiftool for each invocation. =over 5 -=item B<-api> I<OPT[[^]=[VAL]]> +=item B<-api> [I<OPT[[^]=[VAL]]>] Set ExifTool API option. I<OPT> is an API option name. The option value is set to 1 if I<=VAL> is omitted. If I<VAL> is omitted, the option value is -set to undef if C<=> is used, or an empty string with C<^=>. See -L<Image::ExifTool Options|Image::ExifTool/Options> for a list of available -API options. This overrides API options set via the config file. +set to undef if C<=> is used, or an empty string with C<^=>. If I<OPT> is +not specified a list of available options is returned. See +L<Image::ExifTool Options|Image::ExifTool/Options> for option details. This +overrides API options set via the config file. =item B<-common_args> |