ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: CanRanBan on October 04, 2018, 12:41:50 AM

Title: [Feature Request] Switch to use standard time format for Creation Time of PNG
Post by: CanRanBan on October 04, 2018, 12:41:50 AM
Since the change "Convert PNG:CreationTime values to/from standard date format" in Version 10.71 of Exiftool the Creation Time does not get recognized under Windows 10. I attached an example that shows the creation time field for two pictures. One with a creation time field added by the 10.70 version and one added with the 11.12 version.

The command used with both versions of Exiftool for the example is: exiftool.exe -if "not $CreationTime" "-CreationTime<${FileName;s/.+_(\d{4})-(\d{2})-(\d{2})-(\d{2})-(\d{2})-(\d{2}).+/$1:$2:$3 $4:$5:$6/}" -ext PNG .

The three screenshots show that the date format gets added properly but the converted format written by newer versions than 10.70 isn't recognized by Windows 10.

Is it possible to get for example a switch to use the standard date format for the Creation Time field with newer versions of Exiftool? I'm still using the old 10.70 version and would like to use newer versions because of the fixes / additions.

Thanks in advance.
Title: Re: [Feature Request] Switch to use standard time format for Creation Time of PNG
Post by: StarGeek on October 04, 2018, 01:05:05 AM
The issue was brought up in this thread (https://exiftool.org/forum/index.php/topic,8807.0.html). 

I just tested with exiftool ver 10.69 and can verify that Windows can read CreationTime (filling the Date Taken property) with that version.
Title: Re: [Feature Request] Switch to use standard time format for Creation Time of PNG
Post by: Phil Harvey on October 04, 2018, 07:29:38 AM
Right.  I thought the problem was the location of the tag, but instead it was the formatting.  I should have spotted this.

Unfortunately it seems that Windows isn't adhering to the PNG specification here (which recommends the format of RFC-1123 section 5.2.14; basically RFC-822 with allowance for a 1-digit day).  Not surprising really, because the Windows PNG support has been very poor.

But in light of this I think I should revert the PNG CreationTime update of Exiftool 10.71.  Instead, I'll add this as an API PNGTimeFormat option as you suggested for those who prefer to adhere to the PNG specification.

Thanks for bringing this up again.

- Phil

Edit: Also, with the current ExifTool version the reformatting you are doing isn't necessary unless there is the possibility of a 4-digit number coming before the date/time.  ie, this should do the same thing:

exiftool.exe -if "not $CreationTime" "-CreationTime<filename" -ext PNG .
Title: Re: [Feature Request] Switch to use standard time format for Creation Time of PNG
Post by: StarGeek on October 09, 2018, 01:38:09 PM
How do you set the api option?  Is it just -api StrictDate-api StrictDate=1?  Or something else?  I'm editing a StackExchange post to reflect the change.
Title: Re: [Feature Request] Switch to use standard time format for Creation Time of PNG
Post by: Phil Harvey on October 09, 2018, 10:01:54 PM
Hi StarGeek,

Both of your options work.  -api strictdate is the same as -api strictdate=1, which is exactly what you need.

- Phil