ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: ajiekc905 on December 05, 2016, 05:51:14 PM

Title: Sorting photos and geotagging at the same time
Post by: ajiekc905 on December 05, 2016, 05:51:14 PM
Hi.
I'm trying to geotag and sort photos at the same time but got an error:
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:Geotime (ValueConvInv) - /Volumes/LUMIX/DCIM/myfilename1.jpg
Without -geotag "~/Desktop/*.gpx" it work as I expected. The same happen when I only geotag photos without moving them .

Here is cli:

exiftool -geotag "~/Desktop/*.gpx" -ext JPG -r /Volumes/LUMIX/DCIM/ -d "%Y_%m/%d"  '-directory<'~/Documents/tst'/${Exif:DateTimeOriginal}/${MakerNotes:LensType;}/${Composite:GroupName;}'


Here is .exiftoolconfig

%Image::ExifTool::UserDefined = (

# Composite tags are added to the Composite table:
    'Image::ExifTool::Composite' => {

        GroupName => {
            Desire => {
                0 => 'FileName',
                1 => 'DriveMode',
                2 => 'SequenceNumber'
            },
            ValueConv => '
           
            $val[1] =~ /\d+\s(\d+).+/;
            my $myindex = $1;

            $myindex = $val[2] if (defined $val[2]);


            if ($myindex>0) {
                #print $myindex. "\n";

                $val[0] =~ m/^(.{2})(\d+)/;
                my $startIndex=$1 . ($2 +1 - $myindex);
                $startIndex;               
            }'

        },



        # **** ADD ADDITIONAL COMPOSITE TAG DEFINITIONS HERE ****
    },
);

Title: Re: Sorting photos and geotagging at the same time
Post by: StarGeek on December 05, 2016, 07:07:22 PM
My first guess is that the -d option is messing up the time format for the geotag.  What happens when you use the command without the -directory part but with the -d option?

edit:  It took me a few minutes to test, as I don't use geotagging option directly (Geosetter FTW), but yes, it appears the -d option is overriding the time data in the gpx file.  I faintly recall seeing the problem before in the forum but can't find the post.
Title: Re: Sorting photos and geotagging at the same time
Post by: Phil Harvey on December 06, 2016, 07:49:13 AM
StarGeek is correct.  -geotag implies "-Geotime<DateTimeOriginal" unless otherwise specified, which requires a properly formatted DateTimeOriginal.  Try specifying an unformatted DateTimeOriginal, like this:

exiftool -geotag "~/Desktop/*.gpx" "-geotime<datetimeoriginal#" -ext JPG -r /Volumes/LUMIX/DCIM/ -d "%Y_%m/%d"  '-directory<'~/Documents/tst'/${Exif:DateTimeOriginal}/${MakerNotes:LensType;}/${Composite:GroupName;}'

(perhaps I should make this the default)

- Phil
Title: Re: Sorting photos and geotagging at the same time
Post by: ajiekc905 on December 06, 2016, 08:20:30 AM
Quote from: Phil Harvey on December 06, 2016, 07:49:13 AM

(perhaps I should make this the default)

- Phil

It would be nice to show such an example in help page because I spent too much time trying to make it work before posting this question.

An additional question: How to suppress warning messages like this one:
"Warning: Time is too far before track in File:Geotime (ValueConvInv) - /Volumes/LUMIX/DCIM/102_PANA/P1000000.RW2"
But not all of them.

Thanks.
Title: Re: Sorting photos and geotagging at the same time
Post by: Phil Harvey on December 06, 2016, 08:37:35 AM
You can't suppress just a single warning tag.  -m suppresses only minor warnings, and -q -q suppresses them all.

I'll update the documentation and make DateTimeOriginal# the default for the next release.

- Phil
Title: Re: Sorting photos and geotagging at the same time
Post by: ajiekc905 on December 06, 2016, 04:46:40 PM
Thanks
Title: Re: Sorting photos and geotagging at the same time
Post by: ajiekc905 on January 08, 2017, 04:58:22 AM
Found something I haven't expected.
 
exiftool -copyright='A A' -Artist='____@GMAIL.COM' -progress -geotag "~/Desktop/gpx/*.gpx" "-geotime<datetimeoriginal#"   -d "%Y_%m/%d"    -ext ORF -ext CR2 -ext NEF -ext RW2  '-directory<'$nas'/${Exif:DateTimeOriginal}/${LensShort;}/${Composite:GroupName;}' -r "$1"

exiftool  -copyright='A A' -Artist='____@GMAIL.COM' -progress  -d "%Y_%m/%d" -ext ORF -ext CR2 -ext NEF -ext RW2 '-directory<'$nas'/${Exif:DateTimeOriginal}/${LensShort;}/${Composite:GroupName
    ;}' -r "$1"
 
exiftool -copyright='A A' -Artist='____@GMAIL.COM' -progress  -api largefilesupport=1 -ext MP4 -d "%Y_%m/%d"  '-directory<'$nas'/${Exif:DateTimeOriginal}/MP4/' -r "$1"


It used to MOVE files but right now it does COPY.
exiftool -ver
10.36
Title: Re: Sorting photos and geotagging at the same time
Post by: Hayo Baan on January 08, 2017, 06:55:46 AM
I think that since you are changing the file, the original is preserved. If that's the cause then simply adding -overwrite_original should fix it. Another cause could be that you do not have write permissions in the directory (but I think it is my first assumption).
Title: Re: Sorting photos and geotagging at the same time
Post by: ajiekc905 on January 08, 2017, 07:39:45 AM
Solved with "-overwrite_original"
Title: Re: Sorting photos and geotagging at the same time
Post by: Phil Harvey on January 08, 2017, 09:06:37 AM
Just FYI, this is explained in the Notes section here (https://exiftool.org/filename.html#Notes).

- Phil