sorting files: dateTimeOriginal vs CreateDate

Started by lumiere, December 18, 2021, 03:26:43 PM

Previous topic - Next topic

lumiere

I am sorting all pictures I have just used exiftool with the following command:


exiftool "-filename<CreateDate" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r folder


It turned out some of those pictures have different Date and Time Digitized and Date and Time Original and were moved to not the folders I was hoping them to go.
I would assume CreateDate represents the original date/time of when the picture has been taken but refers to Date Time Digitized, am I right ?
Should I change my command to


exiftool "-filename<DateTimeOriginal" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r folder


?

StarGeek

DateTimeDigitized is CreateDate in exiftool.  This refers to when the image was digitized.  DateTimeOriginal is when the image was originally created.  For digital cameras, they would be the same, but if, for example, you where scanning film photos, DateTimeOriginal would be when the camera captured the image and CreateDate (DateTimeDigitized) would be when the image was scanned into the computer.

Whether you should change your command or not depends upon the data.  It's not something that can be definitively chosen without looking at the data.

But if you have one that you would prefer to use, you can use both in a command. Latter options will override earlier options, so you could use
exiftool "-filename<CreateDate" "-filename<DateTimeOriginal" -d pictures/%Y/%m/%d/%Y-%m-%d_%H:%M:%S%%+c.%%e -r /path/to/files/
and exiftool will prefer DateTimeOriginal and fall back to CreateDate if DateTimeOriginal does not exist.

If you wish to find all files where there is a difference between the two, you could use this to list all the files
exiftool -if "$DateTimeOriginal ne $CreateDate" -Filename /path/to/files/
"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

lumiere

Thanks @StarGeek for your explanation - that really clarified the topic for me  :)

By the way - the last with the conditional command is fantastic - however it doesn't display file name(s):

$ exiftool -time:all -a -G0:1 -s 2002-12-08_12\:00\:00_32.jpg
[File:System]   FileModifyDate                  : 2014:05:04 20:04:34+01:00
[File:System]   FileAccessDate                  : 2021:12:18 20:21:30+00:00
[File:System]   FileInodeChangeDate             : 2021:12:14 08:07:32+00:00
[EXIF:ExifIFD]  DateTimeOriginal                : 2014:05:04 20:04:34
[EXIF:ExifIFD]  CreateDate                      : 2002:12:08 12:00:00
$ exiftool -if "$DateTimeOriginal ne $CreateDate" -Filename 2002-12-08_12\:00\:00_32.jpg
1 files failed condition

How do I display filenames when I scan a folder ?

StarGeek

It looks like you're not on Windows.  If so, you need to swap double/single quotes when there's a dollar sign involved.\
exiftool -if '$DateTimeOriginal ne $CreateDate' -Filename /path/to/files/
"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

lumiere

Yes, that is right, this is not windows - it is linux :)
Now it works as expected. However is it possible to format the output ? Currently I get the following output which is difficult for further processing:

======== ./2002-12-08_12:00:00_217.jpg
File Name                       : 2002-12-08_12:00:00_217.jpg
======== ./2002-12-08_12:00:00_256.jpg
File Name                       : 2002-12-08_12:00:00_256.jpg
======== ./2002-12-08_12:00:00_183.jpg
File Name                       : 2002-12-08_12:00:00_183.jpg

I can involve scripting (grep/sed/awk) but maybe it is possible to do that natively just with exiftool ?

StarGeek

"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

lumiere