-1
\$\begingroup\$

How to automatically compile and index the following Windows properties for a batch of photo and video files (grouped across different folders per event) into one nice text-based document or table file? When a photo or video was shot is absolutely important to any creator and needs to be preserved against being overwritten by back-up and editing dates inserted by Windows.

  • Date created
  • Date modified
  • Date last accessed

The problem is that whenever I back up photo and video files,

  1. the date created is changed if I copy them to the back-up drive, or
  2. the original files can't be retained on the source drive if I cut and paste them to a back-up drive.

I need something that aggregates these Windows properties into one document automatically, instead of manually doing it myself.

\$\endgroup\$
6
  • 4
    \$\begingroup\$ This feels like an X-Y problem: why are you trying to do this with Windows properties rather than the EXIF metadata embedded in the file itself? (and stepping back a bit, why are you not using Lightroom/Darktable/etc to do this for you) \$\endgroup\$
    – Philip Kendall
    Commented Mar 12, 2023 at 22:32
  • \$\begingroup\$ I’m voting to close this question because it deal with files meta information and not in photographic aspect. \$\endgroup\$ Commented Mar 13, 2023 at 6:44
  • 2
    \$\begingroup\$ @RomeoNinov I think this is about the photographic aspect, as the OP is trying to effectively maintain their photo catalog. I still think it's the wrong approach though! \$\endgroup\$
    – Philip Kendall
    Commented Mar 13, 2023 at 11:23
  • \$\begingroup\$ @PhilipKendall, for me this is file management based on the files meta information. Replace word "photo" with "video" and the OP should ask the question in totally different site. SuperUser is much more appropriate. \$\endgroup\$ Commented Mar 13, 2023 at 12:09
  • 1
    \$\begingroup\$ Encode the creation date in the filename? \$\endgroup\$
    – Peter M
    Commented Mar 13, 2023 at 13:33

1 Answer 1

1
\$\begingroup\$

On non-Microsoft filesystems, "Date created" in file systems has always meant "date the file was added to the file system it is sitting on", so it is set to the time the file is copied, and is not an absolute date that never changes. On Microsoft file systems, it depends if the file is copied to the file system (from the same or another FS) (new time stamp) or moved (also from the same or another FS) (time stamp is kept)(*). So that explain Ctrl-C/Ctrl-V which is a copy, and Ctrl-X/Ctrl-V which is a move. But not all Microsoft FS support it.

If you want to get the "shooting date", then it is part of the image EXIF metadata data:

  • DateTimeOriginal (0x9003)
  • DateTimeDigitized (0x9004)

(usually identical on picture from cameras)

"Date of last access" is of little value/low trust because it requires writing back to the file system. So 1) it's not good for performance, 2) it's not good for media wear (SSD...) and 3) it may even bee not possible (read-only file system, because of media type, or access privileges). Modern filesystem have developed various strategies to mitigate this, but most of these rely on the idea that access time isn't critical (for instance, on the NTFS file system, it is accurate to a day (*), and may not be updated for over an hour). In addition, many things change it, even when not needed (thumbnails, etc...).

So you are left with the modification date(**), but this is taken care of by proper use of file utilities. Copying/moving a file to another drive shouldn't change this. EXIF data also has a field for this, DateTime (reported as ModifyDate by exiftool)(0x0132)

You can get these dates with various utilities, the exiftool command line utility being quite popular:

> exiftool -dateTimeOriginal -modifydate SomePhoto.jpg 
Date/Time Original              : 2023:03:06 16:00:12
Modify Date                     : 2023:03:08 23:41:34

Exiftool has extensive formatting abilities, so you can generate a line with all the info you need for each file, see examples here. For instance to create a CSV for the files shoot date and last modification date (Unix syntax, quoting is likely different on Windows):

exiftool -p '"$filename";"$dateTimeOriginal";"$modifydate"' *.JPG > photos.csv

yields:

"IMG_9737.JPG";"2023:03:06 16:00:12";"2023:03:06 16:00:12"
"IMG_9739.JPG";"2023:03:07 13:59:34";"2023:03:07 13:59:34"
"IMG_9740.JPG";"2023:03:07 13:59:50";"2023:03:07 13:59:50"
"IMG_9741.JPG";"2023:03:07 13:59:50";"2023:03:07 13:59:50"
"IMG_9743.JPG";"2023:03:07 14:00:07";"2023:03:07 14:00:07"
"Edited1.JPG";"2023:03:06 16:00:12";"2023:03:08 23:41:34"
"Edited2.JPG";"2023:03:06 16:00:12";"2023:03:07 14:08:15"

Exiftool also supports video (at least it can show the same information from .MOV out of my Canon camera).

(*) Some good background information here and here

(**) This date misses an important information: it is not changed if a file is renamed, so a backup may overlook the change. Unix file systems (OSX, Linux) also have a "change date" to support this.

\$\endgroup\$
6
  • \$\begingroup\$ "Date created" is NOT "the date the file was added to the file system it is sitting on" or "the time the file is copied". I know because I just cut and pasted a file to an external HDD last night and the pasted file retained the Creation Date as if it were the original, which was deleted at source upon cutting and pasting. The Creation Date only changes during file transfer when you copy and paste to a new system or drive, which is the situation you just described. \$\endgroup\$
    – user610620
    Commented Mar 13, 2023 at 22:24
  • \$\begingroup\$ Date modified, on the other hand, like what you say, definitely seems to be static for both when you're copy pasting or cut pasting. However, it rarely corresponds to creation date, often being 10 mins after a video file's creation date, I guess meaning that Date Modified is when the file finished recording versus when you started recording. \$\endgroup\$
    – user610620
    Commented Mar 13, 2023 at 22:32
  • \$\begingroup\$ exiftool seems to do the job from your output, but still needs a next step to paste into a csv notepad. Would like to know of similar alternatives, preferably no download and install of obscure software. \$\endgroup\$
    – user610620
    Commented Mar 13, 2023 at 22:35
  • 2
    \$\begingroup\$ OK, the behavior of Microsoft is a bit different, see here. But it still means that it can change... The last exiftool example ( with ` photos.csv` at the end) creates the CSV file directly. And it is and example it can be enhance to create a CSV with a whole disk of photos if necessary. \$\endgroup\$
    – xenoid
    Commented Mar 13, 2023 at 23:29
  • 2
    \$\begingroup\$ With all due respect, exiftool is not "obscure software"; it is absolutely 100% the standard tool for any kind of scripted management of photo metadata. \$\endgroup\$
    – Philip Kendall
    Commented Mar 14, 2023 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.