Dates data accuracy hierarchy

Started by Tommi, March 29, 2021, 04:20:42 AM

Previous topic - Next topic

Tommi

Hello everybody, nice to be here. I looked around a bit in this rich and insightful forum, but I could not find an answer to the questions I am going to write. I hope you can help me and I hope that what I ask makes sense, also because I have a ton of pictures to sort and clean up and this doubt is driving me mad.

So, let's get to the point: I have 10000+ pictures that I am renaming according to the date they have been shot. Such pictures come from several different sources: my camera, my phone, Flickr, Google Photos, hence they all have different kinds/sets of data. Not all of them have EXIF data, thus in some cases I need to rely on file information.

From whis stems my main question: which date format is the most reliable / accurate?

My current workflow is this:
I cd in the folder where my pictures are, and then I perform the commands which I will paste below (in the exact same order they appear). My reasoning is this: I perform the sorting/renaming first with parameters that any picture has (for example the file's modification date), but most of the time not very accurate; successively, I run commands (such as renaming based on EXIF data of a picture) that give very accurate results, but which unfortunately only pictures with a rich set of metadata have.

Here are my commands:
2nd:   exiftool '-FileName<DateTimeCreated' -d %Y.%m.%d\ -\ %H.%M.%S%%c.%%le -r ./*
3rd:   exiftool '-FileName<CreateDate' -d %Y.%m.%d\ -\ %H.%M.%S%%c.%%le -r ./*
4th:   exiftool '-FileName<DateTimeOriginal' -d %Y.%m.%d\ -\ %H.%M.%S%%c.%%le -r ./*
5th:   exiftool '-FileName<GPSDateTime' -d %Y.%m.%d\ -\ %H.%M.%S%%c.%%le -r ./*

Using this system, I thought that I would get the best accuracy possible, and that this method was the most reliable for my use case.

As it turns out, I was wrong: some pictures appear with dates prior to the day they where shot (and I know it because precisely I remember the occasion). I really cannot find an explanation for this. I was prepared to get some wrong dates for pictures with no or little metadata, where the only information I have is the time I imported them in my computer, but in this case the resulting date should be subsequent to the actual time of shooting, not before!

Do you have any hint or idea about why could this happen? Do you think that the order I follow to perform my commands gives the best result possible, or should I change it?


Thank you very much in advance! Any answer would be vital for me; as I said, I am definitely losing it.

Best,
T

Luuk2005

Greetings Tommi, sorry to hear about all of the organization troubles.
Im not expert to know which tags are reliable, but see many people using $Exif:DateTimeOriginal.
IF $Exif:DateTimeOriginal is always the most reliable, you would make that your very last command.

Except not really needing different exiftool commands, because instead they can be just one command like...
exiftool -r -Filename'<Tag1' -Filename'<Tag2' -Filename'<Tag3' -d '%Y.%m.%d - %H.%M.%S%%c.%%le' .
So then Tag3=DateTimeOriginal (if most reliable), since if it exists, will override the previous writings to Filename.

The only thing Im thinking for the "too early" dates, is that maybe the camera did possibly have a counterfeit date?
So then its not possible saying which is most reliable, because they would all be counterfeit, but still can be fixed.
If its me, Im probably do an experiment first by writing the filenames and date-tags into a file.

So then reviewing and hoping to find some logic. Like first looking at some "too earlies" where you now can remember the date.
Then looking at the date-file to find some logic for also finding the other ones, so then you can tell exiftool how to fix them.
Like if the "too earlies" all had some date range in one of the tags, you can use an -if 'DateTagCondition' to find and fix them.

Its hard to advise, so really Im just trying to give some ideas to discover what tags can be reliable.
It might help if you can settle the files into main folders based on "camera, phone, Flickr, GooglePhotos".
If thats even to be possible, so then Im thinking that searching for any logic would then become easier?

If you want to create a date-file, Im usually just make plain text-files, buts its very long -p arguments like...
exiftool -r -ext jpg -d %Y.%m.%d  -api MissingTagValue='          '  -p '#[HEAD]DateCreatd   CreateDate   DT-Originl   GPS-Date     Name' -p '$IPTC:DateCreated   $CreateDate   $DateTimeOriginal   $GPSDateTime   $Directory/$Filename' . >DateFile.txt
I would probably add more search dates, so then having to count the spaces to keep your columns staying vertical.

Many people do prefer creating the csv format, probably because having advanced csv viewers, so then just using...
exiftool -r -ext jpg -csv -d %Y.%m.%d -IPTC:DateCreated -CreateDate -DateTimeOriginal -GPSDateTime . >DateFile.txt
The -csv automatically puts $Directory/$Filename in the first column, so its very ugly format without advanced csv viewers.
Windows8.1-64bit, exiftool-v12.11(standalone), sed-v4.0.7

Tommi

Thank you very much! Your suggestions are very valuable. I will go through them and experiment a bit and I will get back to you with the result.

Best,
T

StarGeek

For images from cameras, the EXIF:DateTimeOriginal and EXIF:CreateDate should be the most accurate, as those would have been set by the camera.  But if the camera's clock was inaccurate then there really isn't much you can do about it, as there won't be any accurate timestamp.

The file system timestamps, such as  FileModifyDate, should also be looked at unless the file has been downloaded from the cloud or a site like Flickr.

DateTimeCreated is a Composite tag that exiftool creates based upon other tags in the file. In this case it's created from the IPTC:DateCreated and IPTC:TimeCreated tags.  IPTC tags (which are IPTC IIM/Legacy) are not created by the camera, only by a program that has edited the image's metadata in some way.  I would not rate them as highly accurate.

The GPSDateTime is another composite tag, created by combining the two GPS timestamps, GPS:GPSDateStamp and GPS:GPSTimeStamp.  This can be set by a camera that is aware of timezones and sets GPS locations in the pictures, such as cell phone cameras, and should be pretty accurate in this case.  It can also be set by later geotagging an image, which might be less accurate.  The main thing to remember about this tag is that the timestamp is in UTC and would have to be adjusted to the local time zone.  Depending upon your time zone, this might show up as the previous day.

And since you mention Flickr and Google Photos, if the images were gathered from a bulk download from those sites and you followed up by copying the metadata from the json sidecar files, then there's a strong possibility that the times could by off.  The json sidecar files for those sites hold the timestamps in UTC.  This might also show up as a previous day.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tommi

Hi! A followup question. Since I realized it does not make sense to use the file Modified Date as its filename, I would like to have a basic name and counter for files that do not have certain data. In particular, I am using the following command:

exiftool '-FileName<CreateDate' '-FileName<GPSDateTime' '-FileName<DateTimeOriginal' -d %Y.%m.%d-%H.%M.%S%%-lc.%%le -r ./*

What should I add in order to rename the file to a custom standard name if it does not have neither CreateDate, GPSDateTime, or DateTimeOriginal?

StarGeek

You would put it before all the others in the command.  You don't say what you're trying to assign, so I can't really help, but it would be something like
'-Filename=CustomName%-c.%e'

%-c is a copy number with a leading dash in case of a name collision and %e is the file extension.  See the -w (-TextOut) option for details on the % variables.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).