a bit long and messy because you have to split each tag and insert the results of Filename in between, but something like
Ok, thanks much. These both worked for me, with
EXIF:XPComment substituted for
UserComment, as far as updating that one tag. I’m going to need to tweak the code for some cases where I have additional text after
p #/#, as it did not work for that.
I did not try using similar code to update
XMP:UserComment due to it being intended as a lang-alt list, and thankfully found that Directory Opus successfully displayed the new value for
EXIF:XPComment. So far, so good.
Curiously, I found that both command lines resulted in some additional EXIF and IPTC tags being created in all files:
EXIF:XResolution
EXIF:YResolution
EXIF:ResolutionUnit
EXIF:YCbCrPositioning
IPTC:Caption-Abstract
Is this supposed to happen? If so, Why?
Another curious thing had happened when I was creating the PNG files to be experimented upon with these ExifTool instructions. I started by using DOpus to create metadata, in the form of
<dopus field name>, in all fields that I would typically use for these scans. For example, in the field that DOpus calls
Author, I put
<author> (including the angle brackets as shown). I then used ExifTool to export all tags to JSON, so I could see which actual tag names were used for what data. The JSON files showed a handful of the EXIF tag values preceded by a question mark:
"EXIF:Artist": "?<author>",
"EXIF:Copyright": "?<copyright>",
"EXIF:Artist": "?<author>",
"EXIF:Copyright": "?<copyright>",
"EXIF:ImageDescription": "?<description>",
"EXIF:Make": "?<camera make>",
"EXIF:Model": "?<camera model>",
"EXIF:Software": "?<creation software>",
The corresponding XMP tags, also created by DOpus, did NOT have a question mark.
I then used DOpus again, to set the tags values I wanted to be operated on by my ExifTool code experiments (
Document Test, prepared by MAZE, 31 May 2020, 17:00:00, p 1/10; Digitization by MAZE, 11 Jun 2020, later truncated to
Document Test, prepared by MAZE, 31 May 2020, 17:00:00, p 1/10, in applicable comment tags). No question marks appeared in any tags exported from these updated PNGs, not even in the tags I hadn’t changed since the earlier JSON exports. Anybody have an explanation?
IPTC:DateCreated doesn't have a time component, so I assume you mean IPTC:TimeCreated
I did see, in the page for IPTC tags (
https://exiftool.org/TagNames/IPTC.html ), that there are separate tags for time and date, but DOpus apparently sets both (as well as
EXIF:DateTimeOriginal and
XMP:DateTimeOriginal) with the same stroke, and ExifTool reports
IPTC:DateCreated with both date and time values in the exported JSONs. If I can’t set them both together using that one tag name, why are they exported together like that? Aren’t I supposed to be able to import all writeable tags from these JSON files?
That could be done with "-DateTimeOriginal+<+<0:0:${Filename;m/0*(\d+)\./;$_=$1}"
I tried:
exiftool "-EXIF:DateTimeOriginal+<+<0:0:${Filename;m/0*(\d+)\./;$_=$1}" "-XMP:DateTimeOriginal+<+<0:0:${Filename;m/0*(\d+)\./;$_=$1}" "-IPTC:TimeCreated+<+<0:0:${Filename;m/0*(\d+)\./;$_=$1}" .…but that gave me:
Warning: No writable tags set from…
Don't you mean “Page 10: 16:59:10”?
Brain fart, my bad. :-) Should have been:
Page 1: 16:59:51
Page 2: 16:59:52
…
Page 10: 17:00:00