ExifTool Forum

ExifTool => Newbies => Topic started by: Jom on July 30, 2022, 12:18:00 PM

Title: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 12:18:00 PM
How do I get ExifTool to display the tag which value I'm requesting, but which is missing from the file?
In the list of tags, I need to check which ones are missing from the file.
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: wywh on July 30, 2022, 01:03:28 PM
I recently noticed that some images lacked ExifIFD:DateTimeOriginal. Before fixing, I searched them with:

exiftool -q -q -ext jpg -ext heic -ext png -ext tif -if 'not $ExifIFD:DateTimeOriginal' -p '$FileName' .
And some images lacked IPTC:TimeCreated which caused Photos.app to display the time as "0.00" although ExifIFD:DateTimeOriginal was correct. I searched them with...

exiftool -q -q -if '$IPTC:DateCreated and not $IPTC:TimeCreated' -p '$FileName' .
...and fixed with:

exiftool -m -P -overwrite_original_in_place -if '$IPTC:DateCreated and not $IPTC:TimeCreated' -IPTC:DateCreated= -IPTC:TimeCreated= .
- Matti
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 01:52:12 PM
1. But I don't know in advance which tags are not in the file. I want to request a list of tags and get either a value or an empty value.
Checking each tag manually is not an option.

2. Why do you use IPTC tags and not the XMP equivalent? I use only EXIF and XMP.
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: greybeard on July 30, 2022, 02:55:57 PM
There may be a better way but I use the tabular -T option and it gives a dash if the tag doesn't exist

exiftool -Make -Model -tag1 -tag2 -T xxx.jpg
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 03:48:06 PM
No, it doesn't fit, I should see the name of the tag that ExifTool didn't find in the file.
And it is required that the output is designed for easy viewing, i.e. a list, not a tab-string.
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: greybeard on July 30, 2022, 04:01:15 PM
-f
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 04:18:19 PM
It looks like this is what I need.
Thanks.

Is it possible to force ExifTool to issue a message if an incorrect tag is entered? In my example, it does not react to the wrong tag in any way.

======== ./MVI_1745.MOV [1/1]
DateTimeOriginal                : 2022:07:27 17:52:58+03:00
KHJGJHJHFGJHGJHkjhgjhJHGJH      : -
Nickname                        : MVI_0000.MOV
    1 directories scanned
    1 image files read
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 04:26:45 PM
But, probably, this is not necessary, because I will be able to see the wrong name at the recording stage.

PS D:\_temp> exiftool -exif:kjhgkjhg='sdfgsdf' .\MVI_1745.MOV
Warning: Tag 'exif:kjhgkjhg' is not defined
Nothing to do.
PS D:\_temp>
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: StarGeek on July 30, 2022, 04:47:36 PM
Quote from: Jom on July 30, 2022, 04:18:19 PMIs it possible to force ExifTool to issue a message if an incorrect tag is entered? In my example, it does not react to the wrong tag in any way.

You can't force a message, but you could change the - into a unique string with the -api MissingTagValue option (https://exiftool.org/ExifTool.html#MissingTagValue).

C:\>exiftool -a -s -AllDates -make -model -FooBar -f -api MissingTagValue="MISSING TAG" y:\!temp\Test4.jpg
DateTimeOriginal                : 2022:07:29 09:47:46
CreateDate                      : 2022:07:29 09:47:46
ModifyDate                      : 2022:07:29 09:47:46
make                            : MISSING TAG
model                           : MISSING TAG
FooBar                          : MISSING TAG
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Jom on July 30, 2022, 05:05:51 PM
Yes, it can be done, but it also reacts only to the missing tag value, but not to its incorrect name.
If ExifTool could report unrecognized tag names when extracting metadata, it would be convenient to find errors in large lists of tags even before writing their values.

ModifyDate                      : 2022:07:29 09:47:46
blabla                          : UNRECOGNIZED

It's perfect, but this does not necessarily, I can get errors in tag names at the recording stage.
Title: Re: I need to see which tags are missing from the file, but which are in my request
Post by: Phil Harvey on July 30, 2022, 05:49:03 PM
Quote from: Jom on July 30, 2022, 05:05:51 PMIf ExifTool could report unrecognized tag names when extracting metadata, it would be convenient to find errors in large lists of tags even before writing their values.

For XMP tags, I do it like this (in Mac/Linux):

exiftool -v FILE | grep adding
- Phil