ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Viktor Nemeth on July 13, 2024, 10:35:07 AM

Title: Inverse geotag and args file (?)
Post by: Viktor Nemeth on July 13, 2024, 10:35:07 AM
Hi Phil,

I'm back with my usual musings re args file.
Trying to do inverse geotagging.
I know that in most of the documentation you use whole folders but I'm trying to do stuff on a file-level basis. (aka assume not all files in a particular folder are of relevance for the output)
The following doesn't work (args file) [doesn't do anything useful that is]

d:\temp\dests\_DSC1458.dng
d:\temp\dests\_DSC1459.dng
-fileOrder=CreateDate
-p=gpx.fmt

things i'd like:
- specify what files' data to extract (kinda like the first two lines above)
- where the output gpx should be (this way i can avoid playing around with the ">" chars in cmd)
- specify the fmt file location (i think this can be done via cmd w/o issues but asking nonetheless.)
- specify fileorder (same as fmt location re comment)

help pls? :)
thanks

v.
Title: Re: Inverse geotag and args file (?)
Post by: StarGeek on July 13, 2024, 11:41:53 AM
Quote from: Viktor Nemeth on July 13, 2024, 10:35:07 AM- specify the fmt file location (i think this can be done via cmd w/o issues but asking nonetheless.)

For this, you would just use the path (full or relative) to the FMT file, e.g.
-p=c:\path\to\gpx.fmt
Quote- specify fileorder (same as fmt location re comment)

I'm not sure I understand. Without the -FileOrder option (https://exiftool.org/exiftool_pod.html#fileOrder-NUM---TAG), the order should be the same as in the FMT file.  With the -FileOrder option, it will be ordered according to the tag used

Example. The temp.txt file has 8 files out of order, but each has a CreateDate in order with the filenames.  The first command lists them according to the order in the ARGS file, the second orders them according to the CreateDate
C:\>type temp.txt
Y:\!temp\Test1.jpg
Y:\!temp\Test7.jpg
Y:\!temp\Test2.jpg
Y:\!temp\Test9.jpg
Y:\!temp\Test3.jpg
Y:\!temp\Test5.jpg
Y:\!temp\Test6.jpg
Y:\!temp\Test4.jpg
C:\>exiftool -G1 -a -s -filename  -@ temp.txt
======== Y:/!temp/Test1.jpg
[System]        FileName                        : Test1.jpg
======== Y:/!temp/Test7.jpg
[System]        FileName                        : Test7.jpg
======== Y:/!temp/Test2.jpg
[System]        FileName                        : Test2.jpg
======== Y:/!temp/Test9.jpg
[System]        FileName                        : Test9.jpg
======== Y:/!temp/Test3.jpg
[System]        FileName                        : Test3.jpg
======== Y:/!temp/Test5.jpg
[System]        FileName                        : Test5.jpg
======== Y:/!temp/Test6.jpg
[System]        FileName                        : Test6.jpg
======== Y:/!temp/Test4.jpg
[System]        FileName                        : Test4.jpg
    8 image files read

C:\>exiftool -G1 -a -s -fileorder CreateDate -filename  -@ temp.txt
======== Y:/!temp/Test1.jpg
[System]        FileName                        : Test1.jpg
======== Y:/!temp/Test2.jpg
[System]        FileName                        : Test2.jpg
======== Y:/!temp/Test3.jpg
[System]        FileName                        : Test3.jpg
======== Y:/!temp/Test4.jpg
[System]        FileName                        : Test4.jpg
======== Y:/!temp/Test5.jpg
[System]        FileName                        : Test5.jpg
======== Y:/!temp/Test6.jpg
[System]        FileName                        : Test6.jpg
======== Y:/!temp/Test7.jpg
[System]        FileName                        : Test7.jpg
======== Y:/!temp/Test9.jpg
[System]        FileName                        : Test9.jpg
    8 image files read
Title: Re: Inverse geotag and args file (?)
Post by: Viktor Nemeth on July 13, 2024, 11:53:54 AM
Hi StarGeek,

Thanks for that however it doesn't seem to work. If my arg file has the content
d:\temp\dests\_DSC1458.dng
d:\temp\dests\_DSC1459.dng
-p=gpx.fmt

i get Warning: Tag 'p' is not defined error
Also this doesn't specify the output gpx file name/path (?)
Title: Re: Inverse geotag and args file (?)
Post by: StarGeek on July 13, 2024, 11:58:43 AM
Sorry, I should have caught that. It's FAQ #29, "My options don't work in a -@ ARGFILE" (https://exiftool.org/faq.html#Q29)

It should be
-p
c:\path\to\gpx.fmt
Title: Re: Inverse geotag and args file (?)
Post by: Viktor Nemeth on July 13, 2024, 12:04:16 PM
That almost works! :) -- thanks

I have a screen output as such:
<?xml version="1.0" encoding="utf-8"?>
<gpx version="1.0"
 creator="ExifTool 12.87"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://www.topografix.com/GPX/1/0"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<number>1</number>
<trkseg>
Warning: [minor] Bad IDC_IFD SubDirectory start - d:/temp/dests/_DSC1458.dng
Warning: [minor] Bad IDC_IFD SubDirectory start - d:/temp/dests/_DSC1459.dng
</trkseg>
</trk>
</gpx>

I can make the warnings hide with -q -q but any way to direct the output into a file? (without using the ">", ie within the args file
Title: Re: Inverse geotag and args file (?)
Post by: Phil Harvey on July 13, 2024, 02:53:54 PM
The output contains no points in the track. :(

Add -W+ out.gpx to your file to write the output to out.gpx.  The warnings will go to stderr, not to the output file, but you can add -m to suppress the minor warnings.

- Phil
Title: Re: Inverse geotag and args file (?)
Post by: Viktor Nemeth on July 14, 2024, 03:49:28 AM
That works, thank you