ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Eric Haas on July 13, 2023, 10:59:52 AM

Title: Syntax for -api option
Post by: Eric Haas on July 13, 2023, 10:59:52 AM
Hi,

I have been using ExifTool for years to geotag photos.  Thanks.

I can do this on the MacOS (latest version) command line:

exiftool -v2 -geotag '/Volumes/Data\ RAID/5D/_GPS/*.gpx' -geosync=+8.5 '-geotime<${DateTimeOriginal}-06:00' /Volumes/Data\ RAID/5D/_Picstotag/

I would like to limit interpolation and extrapolation to 30 seconds.  I can do this via the .ExifTool_config file.  I understand there is also a way to do this via the -api option at the command line.  I can't figure out the syntax to do that.  Is this possible?  It would be ideal to have all my inputs as a single command.

Thanks,
Eric
Title: Re: Syntax for -api option
Post by: StarGeek on July 13, 2023, 11:11:34 AM
See GeoMaxIntSecs (https://exiftool.org/ExifTool.html#GeoMaxIntSecs) and GeoMaxExtSecs just below it.

The -api option (https://exiftool.org/exiftool_pod.html#api-OPT-VAL) is used by listing the api you want to invoke and setting any value you need to set.

I believe the options you want to use would be
-api GeoMaxIntSecs=30 -api GeoMaxExtSecs=30
Title: Re: Syntax for -api option
Post by: Eric Haas on July 16, 2023, 10:08:39 AM
exiftool -v2 -geotag -api GeoMaxIntSecs=30 -api GeoMaxExtSecs=30  '/Volumes/Data\ RAID/5D/_GPS/*.gpx' -geosync=+8.5 '-geotime<${DateTimeOriginal}-06:00' /Volumes/Data\ RAID/5D/_Picstotag/

Produces this output:

Warning: Error opening GPS file '-api' in File:Geotag (ValueConvInv)
Writing File:Geosync
======== GeoMaxIntSecs=30
Setting new values from GeoMaxIntSecs=30
Warning: Error opening file - GeoMaxIntSecs=30
Error: File not found - GeoMaxIntSecs=30
======== /Volumes/Data\ RAID/5D/_GPS/*.gpx
Setting new values from /Volumes/Data\ RAID/5D/_GPS/*.gpx
Warning: Error opening file - /Volumes/Data\ RAID/5D/_GPS/*.gpx
Error: File not found - /Volumes/Data\ RAID/5D/_GPS/*.gpx
======== /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6627.CR2
Setting new values from /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6627.CR2
Warning: No writable tags set from /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6627.CR2
Nothing changed in /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6627.CR2
======== /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6569.CR2
Setting new values from /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6569.CR2
Warning: No writable tags set from /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6569.CR2
Nothing changed in /Volumes/Data RAID/5D/_Picstotag/2022_11_26-6569.CR2
    1 directories scanned
    0 image files updated
    2 image files unchanged
    2 files weren't updated due to errors

It appears that program is interpreting the -api option as a file name.  I'm not sure if I need to put the -api option in a different part of the overall input.

I have re-read FAQ #3 but it doesn't give me any other ideas to try.

I am tagging Canon .CR2 files.

MacOS 13.4.1(c)
ExifTool 12.64
Title: Re: Syntax for -api option
Post by: StarGeek on July 16, 2023, 02:28:55 PM
The -geotag option (https://exiftool.org/exiftool_pod.html#geotag-TRKFILE) requires that the next argument must be the name of the geotrack file.  Because you put -api as the next argument, it is interpreting that as the filename.

You can't split options that require a second argument. Put your -api options after the gps track name.
Title: Re: Syntax for -api option
Post by: Eric Haas on July 17, 2023, 12:18:07 AM
Okay, I understand now.  And yes, that works!  Thanks!

-Eric