Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions exiftool/exiftool
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use strict;
use warnings;
require 5.004;

my $version = '13.17';
my $version = '13.18';

# add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
my $exePath;
Expand Down Expand Up @@ -1391,7 +1391,8 @@ for (;;) {
# add geotag/geosync/geolocate commands first
unshift @newValues, pop @newValues;
if (lc $2 eq 'geotag' and (not defined $addGeotime or $addGeotime) and length $val) {
$addGeotime = ($1 || '') . 'Geotime<DateTimeOriginal#';
$addGeotime = [ ($1 || '') . 'Geotime<DateTimeOriginal#',
($1 || '') . 'Geotime<SubSecDateTimeOriginal#' ];
}
}
}
Expand Down Expand Up @@ -1670,8 +1671,9 @@ if (@newValues) {
# assume -geotime value if -geotag specified without -geotime
if ($addGeotime) {
AddSetTagsFile($setTagsFile = '@') unless $setTagsFile and $setTagsFile eq '@';
push @{$setTags{$setTagsFile}}, $addGeotime;
$verbose and print $vout qq{Argument "-$addGeotime" is assumed\n};
push @{$setTags{$setTagsFile}}, @$addGeotime;
my @a = map qq("-$_"), @$addGeotime;
$verbose and print $vout 'Arguments ',join(' and ', @a)," are assumed\n";
}
my %setTagsIndex;
# add/delete option lookup
Expand Down Expand Up @@ -5984,7 +5986,7 @@ with this command:

produces output like this:

-- Generated by ExifTool 13.17 --
-- Generated by ExifTool 13.18 --
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
Expand Down Expand Up @@ -7808,8 +7810,9 @@ the B<-geotag> option.)

Geotag an image (C<a.jpg>) from position information in a GPS track log
(C<track.log>). Since the C<Geotime> tag is not specified, the value of
DateTimeOriginal is used for geotagging. Local system time is assumed
unless DateTimeOriginal contains a timezone.
SubSecDateTimeOriginal (preferentially) or DateTimeOriginal is used for
geotagging. Local system time is assumed unless the time contains a
timezone.

=item C<exiftool -geotag track.log -geolocate=geotag a.jpg>

Expand Down Expand Up @@ -7854,7 +7857,8 @@ Delete XMP GPS tags which were added by the geotag feature.

=item C<exiftool -xmp:geotag=track.log a.jpg>

Geotag an image with XMP tags, using the time from DateTimeOriginal.
Geotag an image with XMP tags, using the time from SubSecDateTimeOriginal or
DateTimeOriginal.

=item C<exiftool -geotag a.log -geotag b.log -r dir>

Expand Down
23 changes: 11 additions & 12 deletions exiftool/lib/Image/ExifTool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
%jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
%static_vars $advFmtSelf);

$VERSION = '13.17';
$VERSION = '13.18';
$RELEASE = '';
@ISA = qw(Exporter);
%EXPORT_TAGS = (
Expand Down Expand Up @@ -6868,10 +6868,10 @@ sub HDump($$$$;$$$)
# Returns: Trailer info hash (with RAF and DirName set),
# or undef if no recognized trailer was found
# Notes: leaves file position unchanged
sub IdentifyTrailer($;$)
sub IdentifyTrailer($$;$)
{
my $raf = shift;
my $offset = shift || 0;
my ($self, $raf, $offset) = @_;
$offset or $offset = 0;
my $pos = $raf->Tell();
my ($buff, $type, $len);
while ($raf->Seek(-$offset, 2) and ($len = $raf->Tell()) > 0) {
Expand Down Expand Up @@ -6900,6 +6900,9 @@ sub IdentifyTrailer($;$)
$type = 'Vivo';
} elsif ($buff =~ /jxrs...\0$/s) {
$type = 'OnePlus';
} elsif ($$self{ProcessGoogleTrailer}) {
# check for Google trailer information if specific XMP tags exist
$type = 'Google';
}
last;
}
Expand Down Expand Up @@ -7052,7 +7055,7 @@ sub ProcessTrailers($$)
$offset += $dirLen;
last if $dataPos and $$self{TrailerStart} and $dataPos <= $$self{TrailerStart};
# look for next trailer
my $nextTrail = IdentifyTrailer($raf, $offset);
my $nextTrail = $self->IdentifyTrailer($raf, $offset);
# process Google trailer after all others if necessary and not done already
unless ($nextTrail) {
last unless $$self{ProcessGoogleTrailer};
Expand Down Expand Up @@ -7504,11 +7507,7 @@ sub ProcessJPEG($$;$)
}
}
unless ($fast) {
$trailInfo = IdentifyTrailer($raf);
# check for Google trailer information if specific XMP tags exist
if (not $trailInfo and $$self{ProcessGoogleTrailer}) {
$trailInfo = { DirName => 'Google', RAF => $raf };
}
$trailInfo = $self->IdentifyTrailer($raf);
# process trailer now unless we are doing verbose dump
if ($trailInfo and $verbose < 3 and not $htmlDump) {
# process trailers (keep trailInfo to finish processing later
Expand Down Expand Up @@ -8619,7 +8618,7 @@ sub DoProcessTIFF($$;$)
}
# process information in recognized trailers
if ($raf) {
my $trailInfo = IdentifyTrailer($raf);
my $trailInfo = $self->IdentifyTrailer($raf);
if ($trailInfo) {
# scan to find AFCP if necessary (Note: we are scanning
# from a random file position in the TIFF)
Expand Down Expand Up @@ -8724,7 +8723,7 @@ sub DoProcessTIFF($$;$)
for (;;) {
last unless $extra > 12;
$raf->Seek($tiffEnd); # seek back to end of image
$trailInfo = IdentifyTrailer($raf);
$trailInfo = $self->IdentifyTrailer($raf);
last unless $trailInfo;
my $tbuf = '';
$$trailInfo{OutFile} = \$tbuf; # rewrite trailer(s)
Expand Down
2 changes: 1 addition & 1 deletion exiftool/lib/Image/ExifTool/CanonRaw.pm
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ sub ProcessCRW($$)

# process trailers if they exist in CRW file (not in CIFF information!)
if ($$et{FILE_TYPE} eq 'CRW') {
my $trailInfo = Image::ExifTool::IdentifyTrailer($raf);
my $trailInfo = $et->IdentifyTrailer($raf);
$et->ProcessTrailers($trailInfo) if $trailInfo;
}

Expand Down
Loading