Geotag via arg file not displaying actual warning message (no-time-overlap)

Started by Viktor Nemeth, May 02, 2024, 01:10:06 PM

Previous topic - Next topic

Viktor Nemeth

1) Your system type - Windows (10+ but not version specific)
2) The ExifTool version you are using - 12.84 (but also not likely version specific)
3) The specific command line you are using - see below
4) The console output from the command. - see below

Hi Phil,

I'm trying to output an actual error message to the stderr but have found it only triggers when not using an args file. In somewhat more detail I have an args file such as

-geotag=D:\temp\2013-03-23_104201.gpx
-geotime<${DateTimeOriginal#}
-api
GeoMaxIntSecs=1800
-api
GeoMaxExtSecs=1800
D:\temp\001.jpg
-v2
-srcfile
C:\Users\nemet\AppData\Roaming\GeoTagNinja\tmpLocFiles\%F.xmp
-overwrite_original_in_place

In the particular case of the files in consideration we should receive an error message that says "Warning: Time is too far before track in File:Geotime (ValueConvInv) - (filename)" because in fact there's no overlap between the gpx file and the images. However this is not happening, the reasoning isn't displayed.
However if I was to do in cmd
exiftool -geotag=D:\temp\2013-03-23_104201.gpx "-Geotime<DateTimeOriginal#" -api GeoMaxIntSecs=1800 -api GeoMaxExtSecs=1800 D:\temp\001.jpg -v2 -srcfile %F.xmp -overwrite_original_in_place

... that works.

Also if I comment out the "-geotime<${DateTimeOriginal#}" part it also works (see two screenshots)
327487075-2942d184-8515-4fc6-9106-b1d112f35bc5.png
327487263-cf25f77c-a499-488a-952a-8d8c2fc213da.png

there's some more stuff about this at https://github.com/nemethviktor/GeoTagNinja/issues/105 if you'd like screenshots etc.
I had set up the args file as per https://exiftool.org/forum/index.php?topic=14598.msg78652#msg78652

The ask/question is if this is a bug can it be fixed and if not then how can i use the args file (inc possible time zone while ensuring that the actual error message (if any, but such as "Time is too far...") gets displayed?

Phil Harvey

The arguments are not the same on the command line.  In the argument file you are interpolating DateTimeOriginal in a string (${DateTimeOriginal#}) rather than copying directly.  When doing this, warnings are handled somewhat differently, but you will still see the warning at the -v3 level.

There are other differences too.  From the application documentation:

          8) With the redirection feature, copying a tag directly (ie.
            "'-DSTTAG<SRCTAG'") is not the same as interpolating its value
            inside a string (ie. "'-DSTTAG<$SRCTAG'") for source tags which
            are list-type tags, shortcut tags, tag names containing wildcards,
            or UserParam variables.  When copying directly, the values of each
            matching source tag are copied individually to the destination tag
            (as if they were separate assignments).  However, when
            interpolated inside a string, list items and the values of
            shortcut tags are concatenated (with a separator set by the -sep
            option), and wildcards are not allowed.  Also, UserParam variables
            are available only when interpolated in a string.  Another
            difference is that a minor warning is generated if a tag doesn't
            exist when interpolating its value in a string (with "$"), but
            isn't when copying the tag directly.


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).