Author Topic: [Feature Request] Switch to use standard time format for Creation Time of PNG  (Read 1482 times)

CanRanBan

  • Newbie
  • *
  • Posts: 1
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.

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 5453
The issue was brought up in this thread

I just tested with exiftool ver 10.69 and can verify that Windows can read CreationTime (filling the Date Taken property) with that version.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
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 .
« Last Edit: October 04, 2018, 08:37:30 AM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 5453
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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Hi StarGeek,

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).