Setting Date Taken in ExifTool so it shows in Opus

Now this is driving me nuts…

I’m dealing with several JPEGs which, after using ExifTool to take numbers at the beginning of their filenames and write the EXIF/IPTC/XMP fields that basically correspond to writing Date taken via DOpus’ Set Metadata panel, do not display their Date taken values via tooltip nor panel. I have routinely been using ExifTool in this way for months, though nearly always with PNGs that are mostly screenshots, and all of them have displayed their Date taken values in DOpus until now.

The same JPEGS DO display their Date taken values if they’re written by DOpus, but I have a reason for using ExifTool instead of DOpus.

For what it’s worth, these particular problem JPEGs were extracted from PDFs using the command line PDF tool pdfimages.exe (part of the XPDF package of tools).

Even if I convert the JPEGs to PNGs using DOpus, the PNGs won’t display their Date taken values either, whether they were written before or after the conversion. I also converted one of my screenshot PNGs to JPEG and wrote the Date taken equivalent fields to it using ExifTool, and that JPEG DOES correctly display it afterwards.

I’m using DOpus v12.23, but it happened with these JPEGs under v12.22 also. My version of ExifTool has not changed since June.

Attached: “2020-12-31 19;17;57 - Meta Date Taken Test.7z”

Contents:

“2020-12-31 19;17;57 - Meta Date Taken Test\”
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.jpg” (5,135) [57 x 75 x 24]
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.jpg_original” (2,165) [57 x 75 x 24]
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.png” (10,452) [57 x 75 x 24]
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.png_original” (9,855) [57 x 75 x 24]
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.jpg.json” (466)
“1952-12-00 00;06;00 - Farm Journal - 006 [3]-57x75.png.json” (466)
“2020-12-31 19;03;05 - Directory Opus - Help.png” (20,549) [580 x 320 x 24]
“2020-12-31 19;03;05 - Directory Opus - Help.png.json” (699)

“_original” files are the files prior to using ExifTool on them.

“2020-12-31 19;03;05 - Directory Opus - Help.png” is a screenshot, with Date taken written using same ExifTool command as for other included image files, but displays Date taken correctly.

Otherwise… happy new year, everyone!

2020-12-31 19;17;57 - Meta Date Taken Test.7z (31.8 KB)

and write the EXIF/IPTC/XMP fields that basically correspond to writing Date taken

Which field(s) specifically?

What is the ExifTool command you're running?

Are you only setting the value in one of the tag types and leaving the other two as they were? That can confuse things, since different software may give different tags priority (or not read them at all). Removing everything except EXIF is a good thing to try in case that kind of thing is happening.

The JSON files in the 7-zip attached to my previous message should indicate clearly what was written where, but here’s my ExifTool command line:

ExifTool -progress -echo "Writing date taken from filename(s)..." -m "-EXIF:DateTimeOriginal<filename" "-XMP:DateTimeOriginal<filename" "-IPTC:DateCreated<${filename;m/^(\d{4})[-_;\., ]*(\d{2})[-_;\., ]*(\d{2})/;$_=$1.$2.$3}" "-IPTC:TimeCreated<${filename;m/^\d{4}[-_;\., ]*\d{2}[-_;\., ]*\d{2}[-_;\., ]*(\d{2})[-_;\., ]*(\d{2})[-_;\., ]*(\d{2})/;$_=$1.$2.$3}" .

DOpus writes IPTC:DateCreated under at least certain circumstances — I’m guessing if IPTC:SpecialInstructions (Instructions) and/or IPTC:ObjectName (Title), maybe others, are written along with a Date taken entry — but writes both date and time data to it, whereas IPTC:TimeCreated is where the time component is actually supposed to be stored, and IPTC:DateCreated is supposed to be date only, according to the gurus over at ExifTool.

Seems none of the tags you write exist in the original files. So:

Additionally/Alternatively try EXIF:CreateDate instead of EXIF:DateTimeOriginal.

Suggestions are appreciated, though I’m not at a point where I’m tempted to resort to that. I mainly brought this issue up because Directory Opus’ behavior in displaying/not displaying Date taken appears to be inconsistent, OR there’s something screwy about the JPEGs in question that persists even when using resized or converted versions. Date taken displays for the vast majority of files I run my ExifTool filename-to-date-taken command line on, but not these particular JPEGs, nor any resized versions of them, nor any conversions to PNG. All resizing and conversions were done by DOpus, so even if there was something special/incompatible about the original JPEGs (which, again, were extracted from PDFs using a separate tool), I would think that DOpus would either create compatible resized/converted files, or it would complain about something being wrong with the source JPEGs.

But EXIF:CreateDate corresponds to Date digitized in DOpus, and that’s what I use it for. In the case of these problem JPEGs, they are scans of pages of a magazine from December 1952 that were digitized yesterday, so I wish to have Date taken set to 1 December 1952 and a time value based on the page number, and I wish to have Date digitized set to whatever time yesterday.

Can anyone confirm that the problem JPEGs do not display their respective Date taken on their own end, that I’m not the only one experiencing the issue with them?

The day in the non-working files is 0 (1952-12-00 00;06;00). ExifTool writes this without any warnings. It looks like Directory Opus doesn't show anything if its not a valid date.

1 Like

@Disco

Good eye, right you are, and my bad. Completely overlooked that. I changed the date string in the filenames to 1952-12-01, re-ran my ExifTool command, and now the dates are visible in DOpus (and I subsequently restored the original filenames). Thanks much!

If anybody’s curious as to why I had the dates in the filenames expressed as 1952-12-00, it’s because the official publication date of the scanned magazine issue was December 1952, rather than a specific date, and it’s common for magazines to be available and/or arrive at a subscriber’s address one or more days BEFORE the official publication date anyway.

I’d guess that writing dates with day numbers as 0 and not even complaining about it might be a bug or oversight on the part of ExifTool, so I’ll head over to their forum and bring it up. Thanks again.