Updating EXIF:ExifIFD:SerialNumber results in two tags updated, not one

Started by Hayo Baan, November 03, 2014, 05:48:53 AM

Previous topic - Next topic

Hayo Baan

Hi Phil, based on my findings from this thread I decided to add a correction for the SerialNumber to my metadata check script (using my own wrapper classes around the ExifTool Library).

When the script determines that the SerialNumber (in Exif) is not equal to the one in the Makernotes, it updates it. This is done using SetNewValue, with the fully specified tagname (EXIF:ExifIFD:SerialNumber in this case). So this should really only attempt to update a single tag. However when I call CountNewValues, it tells me two tags are updated :o
For all other tag updates, this has worked as expected (only one tag counted), so what's up here, what other tag (if any) is written?

Related to this, is it possible to determine the exact tags (i.e., fully qualified tag names) that will actually be written, currently there doesn't seem to be an API for this? This would (also) be handy in case one uses SetNewValue without fully qualified tag names.
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Hi Hayo,

CountNewValues() may return a very large number for some tags (try writing WhiteBalance for example).  These are all of the tags that are possible to write based on the input conditions (for example, there are many different Canon:WhiteBalance tags because different models write this information in different locations).  However, depending on the file processed, not all of these tags will be written.

I hope this answers your question.

- 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 ($).

Hayo Baan

Quote from: Phil Harvey on November 03, 2014, 07:15:35 AM
CountNewValues() may return a very large number for some tags (try writing WhiteBalance for example).  These are all of the tags that are possible to write based on the input conditions (for example, there are many different Canon:WhiteBalance tags because different models write this information in different locations).  However, depending on the file processed, not all of these tags will be written.

I hope this answers your question.

I understand what you are saying, but wouldn't these other tags also have to show up with the -a option (and in my script as I go through each and everyone that you have found)? For the WhiteBalance sample on a Canon image I indeed do get three possible values (one in Exif, two in Makernotes). But not so for the serial number (only one in both Exif and Makernotes, and I only fully specify the Exif one to be written).
So I'm still a bit confused  :(
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Hi Hayo,

The new values are established before any input files are processed.  If you understand this, then things should make sense.  (I hope.)

- 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 ($).

Hayo Baan

Hi Phil,

Quote from: Phil Harvey on November 03, 2014, 09:57:07 AM
The new values are established before any input files are processed.  If you understand this, then things should make sense.  (I hope.)

Ah, so I guess there are two places where EXIF:ExifIFD:SerialNumber might end up, right, that would explain things. So then my question becomes, is there a way to find out exactly which tags did get written? Not terribly important, just curious  ;)
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Hi Hayo,

There is no real way to do this, other than using the Verbose option, but that is mainly just for debugging purposes.

- 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 ($).

Hayo Baan

Hi Phil,

Yeah, I figured. I already tried verbose and it indicated what happened, but that is no good for use in scripts. But as I said, this is no real problem for me anyway.

Cheers,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

I am looking into your specific example of two ExifIFD:SerialNumber's.  Interesting...

- Phil

Edit:  Ah, right.  There is the old 0xfde9 Photoshop tag (which is avoided when writing) as well as the new 0xa431 EXIF tag.
...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 ($).

Hayo Baan

Quote from: Phil Harvey on November 03, 2014, 11:18:52 AM
Edit:  Ah, right.  There is the old 0xfde9 Photoshop tag (which is avoided when writing) as well as the new 0xa431 EXIF tag.

Ah, that explains it, thanks for all your time on this :D

Cheers,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl