If, like me, you have digital photo’s stretching back to the early days of digital cameras and even scans of film and slides, then you may have the same issue I had attaching the right date to the file. I have over 35,000 digital images, so developed a little command line tool to help called ‘Image Processing Console‘ (https://github.com/nrogoff/ImageProcessingConsole).
Modern cloud photo facilities like Microsoft OneDrive Photos and Google Photos automatically organise images based on the dates. Which is great, unless you are missing the correct ‘Date Taken‘. These and other catalogs seem to use a preference order as so where they get this date from. I imagine it’s something like
- Date in the image metadata (EXIF, IPTC or XMP!). There are several dates often stored here. Exactly which is considered the definitive ‘Date Taken’ is not clear.
- If no metadata found , then the image files created date is used. This can and is often completely wrong if you scanned a photo or even did copying and editing.
In Windows you can easily view which of your images have valid ‘Date Taken‘.
- In Windows Explorer, change the view to ‘Details’, then right-click on the columns and add the ‘Date taken’ column.
- You should then see a listing like this, clearly showing if the image does not contain the right metadata.
- If you also turn on the Details pane (View ribbon), you can manually edit the ‘Date taken’, as well as other details.
Some images are too old to have metadata, other have lost their metadata after being edited and yet more are missing it as they were scanned direct from photographs, slides and film.
The created and modified dates can also easily become useless once they are copied from system to system and disk to disk.
Image Processing Console (open source project)
To resolve missing ‘Date Taken‘ metadata in images files, I have just created an open-source command line tool. This tool can be used to set a specific ‘Date Taken’ on one or more files, or you get ask it to infer a shot taken date based on other files close by.
You can get more details on GitHub at https://github.com/nrogoff/ImageProcessingConsole and download the latest release or source code here. It’s functionality is currently limited to JPG’s only.
Just unzip the ‘ImageProcessingConsole.zip‘ and extract it to some folder. Then open command console at this location.
>ImageProcessingConsole --help ======= HMS Image Processing Console App ======= Image Processing Console 188.8.131.5258 Copyright © Nicholas Rogoff 2016 MIT License -------- Examples ------- - Update a single image >ImageProcessingConsole -f "c:\myphotos\myphoto.jpg" -s 2003-11-17 - Update all images in a folder (inferred) >ImageProcessingConsole -f "c:\myphotos\\" -f, --filepath Required. The full path of the image file, including the filename and extension (jpg only). Or the folder to search and fix all 'Date Taken' metadata in JPGs only. NOTE: You need to add an extra '\' at the end when specifying a folder. -i, --includeSubfolders Include subfolders. Use in combination with folder searches. -s, --shottakendate Set to this Shot Taken Date. Date must be formated as follows 'yyyy-mm-dd hh:mm:ss'. If this date is not specified then the 'Date Taken' (if exists) of the nearest file in the same folder (ordered by name) will be used. -o, --overwrite Force overwrite of 'Date Taken' even if one already exists for the file. --help Display this help screen.
Bulk update missing ‘Date Taken’
The most useful facility is when you have the odd image here and there that does not have a ‘Date Taken‘. This will probably be the images that you did some work on and saved a copy etc..
If you don’t supply a ‘shot taken date‘ (-s) then the app will try to infer a date based on image files in the same folder that do have dates.
The app will find the closest file by searching the files before and after when ordered alphabetically ascending.
When targeting specific files (without specifying a ‘shot taken date‘), we can see as shown below, that Faces-28.jpg will be given the 26/05/2006 02:21, but Faces-30.jpg will given 18/04/2004 07:49
>ImageProcessingConsole -f "D:\Gallery - Faces\Faces-28.jpg"
>ImageProcessingConsole -f "D:\Gallery - Faces\Faces-30.jpg"
When targeting a folder then the preceding date cascades down.
>ImageProcessingConsole -f "D:\Gallery - Faces\\"