ExifTool > The Image::ExifTool API

Reported number of tags changed different since 11.40

(1/3) > >>

Hayo Baan:
Hi Phil,

I noticed the reported tag count of the changed tags when writing the file updates using the API has changed. Where I previously got only 5 tags reported (I update 4 tags & delete 1 tag so this is the expected number), I now get 7 reported. Any idea what's going on and what caused the change in the number?

Note: looking at the output of exiftool run on the before and after files, I notice a couple more tag changes, but these are all internal (e.g. offsets and xmp toolkit) and imo shouldn't be counted (and some of these definitely aren't or otherwise the count would have been 9).

Here's the diff of the (sorted) output of exiftool -a -G0:1 when run on the before and after files (I removed the reported changes in the Composite and File:System tags from the output since these are inevitable and therefore uninformative):

--- Code: ---26c26
< [EXIF:ExifIFD]  Create Date                     : 2015:01:02 17:32:59
---
> [EXIF:ExifIFD]  Create Date                     : 2015:01:02 16:32:59
28c28
< [EXIF:ExifIFD]  Date/Time Original              : 2015:01:02 17:32:59
---
> [EXIF:ExifIFD]  Date/Time Original              : 2015:01:02 16:32:59
58d57
< [EXIF:ExifIFD]  User Comment                    :
63c62
< [EXIF:IFD0]     Copyright                       : Copyright Hayo Baan - Photography
---
> [EXIF:IFD0]     Copyright                       : © Hayo Baan – Photography. All Rights Reserved.
76c75
< [EXIF:IFD1]     Thumbnail Offset                : 14766
---
> [EXIF:IFD1]     Thumbnail Offset                : 14728
114c113
< [MPF:MPImage2]  MP Image Start                  : 93092
---
> [MPF:MPImage2]  MP Image Start                  : 93058
320c319
< [MakerNotes:PreviewIFD] Preview Image Start     : 15736
---
> [MakerNotes:PreviewIFD] Preview Image Start     : 15698
325,326c324,325
< [XMP:XMP-x]     XMP Toolkit                     : Image::ExifTool 9.77
< [XMP:XMP-xmp]   Create Date                     : 2015:01:02 16:32:59+02:00
---
> [XMP:XMP-x]     XMP Toolkit                     : Image::ExifTool 11.43
> [XMP:XMP-xmp]   Create Date                     : 2015:01:02 16:32:59.30+01:00

--- End code ---

Phil Harvey:
Are you talking about the count returned by SetNewValue()?  This is the number of new tag values set and queued to be written, but it has nothing to do with the actual number finally written to the file.  The final number depends on specifics of the file, most importantly the file type.

- Phil

Hayo Baan:

--- Quote from: Phil Harvey on May 21, 2019, 08:24:23 AM ---Are you talking about the count returned by SetNewValue()?

--- End quote ---
Yes, I mean the return value of SetNewValue().


--- Quote from: Phil Harvey on May 21, 2019, 08:24:23 AM ---This is the number of new tag values set and queued to be written, but it has nothing to do with the actual number finally written to the file.  The final number depends on specifics of the file, most importantly the file type.

--- End quote ---
Understood, but since I set just 5 tags, shouldn't that then have been the reported number? It was the number of reported tags before 11.40, so somewhere in 11.40 you changed the way the number is determined.
Not a big problem (I just needed to replace 5 with 7 in the expected test outcome), but I'm just curious as to how I should then interpret the number, because now it has nothing to do with
a) the number of tags (5 not 7) I specified to have changed (note that I specify the tag including the location, so there are no duplicates that can get set as part of the update), nor
b) the number of tags actually changed (9 in this case, not 7)

Phil Harvey:
I likely just added some new writable tags.  You can use the application -v2 option to see what tags are being queued.  For example:


--- Code: ---> exiftool a.jpg -artist=me -v2
Writing PNG:Artist
Writing ItemList:Artist
Writing Keys:Artist if tag exists
Writing UserData:Artist if tag exists
Writing Pentax:Artist if tag exists
Writing XMP-tiff:Artist if tag exists
Writing XMP-xmpDM:Artist if tag exists
Writing IFD0:Artist
======== a.jpg
Rewriting a.jpg...
--- End code ---

In this output, ItemList, Keys and UserData tags would have been added to the list in recent versions of ExifTool.

Good question about how to interpret the number.  Certainly if it is zero then it isn't doing what you want.  If it is many more than you expect, then you may want to narrow things down by specifying a group name for the tag.

- Phil

Hayo Baan:

--- Quote from: Phil Harvey on May 21, 2019, 08:56:07 AM ---I likely just added some new writable tags.  You can use the application -v2 option to see what tags are being queued.  For example:

[snip]

In this output, ItemList, Keys and UserData tags would have been added to the list in recent versions of ExifTool.

Good question about how to interpret the number.  Certainly if it is zero then it isn't doing what you want.  If it is many more than you expect, then you may want to narrow things down by specifying a group name for the tag.

--- End quote ---

But I am specifying the exact group! So there really can (should) be only one location the data is written to. Also when you look at what was actually written by exiftool it really was just those 5 tags (plus the internal tags I mentioned but those shouldn't be counted).

Navigation

[0] Message Index

[#] Next page

Go to full version