Request: include "00" as valid within the range check for month/day in exif-date

Started by Klaus Thon, May 17, 2021, 10:59:23 AM

Previous topic - Next topic

Klaus Thon

I want to focus on exiftool's handling of unknown month or day in dates as used in iptc-, exif-, and xmp-metadata.

The IPTC IIM (V 4.1, 1999) specification states: "2:55 Date Created (...) Where the month or day cannot be determined, the  information  will  be  represented  by  '00'.  Where  the  year cannot be determined, the information for century and year will be represented by '00'. (...)". If the Time Created is unknown, this tag will be omitted.

The Exif specification (V 2.2, 2002) states: "F. Tags Relating to Date and Time, DateTimeOriginal: (...) When the date and time are unknown, all the character spaces except colons (':') may be filled with blank characters (...)". This sounds strange, for example a DateTimeOriginal-entry for a scanned picture from year 1964 with unknown month and day would look like the 20 bytes long string "1964:  :     :  :  " (if I understand the wording correct).

The XMP-specification (Part 1, 2012) states: "8.2.1.2 Date. A date-time value is represented using a subset of the formats as defined in Date and Time Formats: YYYY, YYYY-MM, YYYY-MM-DD (...)". This means that unknown month, day, or time will simply be omitted.

Current release of exiftool (12.25) supports both the iptc- and the xmp-spec to write a date with unknown month or day, for example "19640000" (iptc) or "1964" (xmp), without range check for month or day. Writing an exif-date with unknown month and/or day as "00" will be rejected due to a range check introduced in exiftool version 11.39. Older exiftool versions (I found a version 8.89 in my backup) accept the exif-date "1964:00:00 00:00:00" (but not the strange date string "1964:  :     :  :  ").

In short: my suggestion is to include "00" as valid value within the range check for month and day in exif-date.

Thanks,
Klaus

StarGeek

Quote from: Phil Harvey on February 05, 2018, 07:47:09 AM
See FAQ 5.  As well, technically it is allowed, although not recommended, to leave EXIF date/time fields blank (filled with spaces).  To do this you must add the -n option when writing with ExifTool.

- Phil

You can add the -n (--printConv) option or it's hashtag shortcut and write whatever you want to the EXIF timestamps. Even non-date/time data.
C:\Programs\My_Stuff>exiftool -P -overwrite_original -DateTimeOriginal#="1964:00:00 00:00:00" -CreateDate#="1964:  :     :  :  " -ModifyDate#="12 Monkeys" y:\!temp\Test4.jpg
    1 image files updated

C:\Programs\My_Stuff>exiftool -g1 -a -s -AllDates y:\!temp\Test4.jpg
---- IFD0 ----
ModifyDate                      : 12 Monkeys
---- ExifIFD ----
DateTimeOriginal                : 1964:00:00 00:00:00
CreateDate                      : 1964:  :     :  :
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Klaus Thon

You are right, I missed the -n option (and the FAQ as well, sorry).
Thanks,
Klaus