Closed aseques closed 5 years ago
As the exiftool output shows, the original date/time is set to all zeros, which is not a valid value (day and month can't be less than 1). The "does not match format" message is misleading in this case, but I think that's direct from the Python datetime module. Photini reported the error and didn't crash, so I'm not sure there's much more it could do.
Yeah, I just wanted to let you know the behavior in this case, I fixed the image from photini itself easily
Thanks. It's surprising how many ways photo metadata can be messed up. I think the best thing to do is leave it to the user to correct, rather than try any guesswork. One of my colleagues, many years ago, often raged against "machines that think they know best". I bear this in mind, along with Postel's law, when I write software.
Totally agree, thanks
Interestingly Python gives a different message when only the year is out of range:
>>> datetime.strptime('0001:01:01 00:00:00', '%Y:%m:%d %H:%M:%S')
datetime.datetime(1, 1, 1, 0, 0)
>>> datetime.strptime('0001:01:00 00:00:00', '%Y:%m:%d %H:%M:%S')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/usr/lib64/python3.6/_strptime.py", line 362, in _strptime
(data_string, format))
ValueError: time data '0001:01:00 00:00:00' does not match format '%Y:%m:%d %H:%M:%S'
>>> datetime.strptime('0000:01:01 00:00:00', '%Y:%m:%d %H:%M:%S')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/usr/lib64/python3.6/_strptime.py", line 528, in _strptime
datetime_date(year, 1, 1).toordinal() + 1
ValueError: year 0 is out of range
I've checked the Exif standard (v 2.2) and it doesn't mention all-zero DateTimes. It does allow all the numbers to be replaced by spaces to indicate a missing value. If using all zeros is commonly done then Photini ought to accept it.
A bit of web searching suggests this is quite common, so commit 62d98a9 should make Photini accept all-zeros as a None value.
I was tagging some pictures taken a time ago, and found out these errors on a picture, I attached the output of exiftool in case it's interesting for you info.txt The image it's missing the Date/Time Original in exiv information, but it does have a modify time, I don't know if it's something related to this manufacture (other pictures from same camera don't have the same issue strangely)
Feel free to close if it's the expected behaviour.