Solution name: lr-datetime-equalize
Current Version: V1.00 2011/07/15
Metadata type/form, e.g. photo, video, PDF, etc.: photo
Solution type, e.g. date/time, filename, etc.: date/time
Platform: Windows
Purpose: To match all photo file date/time metadata fields to the same master date/time value.
Problem solved: Many photo organizing and editing tools allow the change of one or more date/time metadata fields. Doing so leaves the photo file(s) with some date/time fields that do not match. Different photo geotagging, organizing and editing tools, as well as photo hosting web sites, use different date/time metadata fields to establish the date/time for the photo. This can cause many problems related to geolocation, photo sorting, photo display order, etc. By equalizing, or matching, the date/time information across all metadata date/time fields, the photos will will be treated processed, displayed, etc. the same by all photo tools and web sites.
Relevant applications: Digital photo or video files whose date/time was edited by any photo organizing / editing application that allows the edit of a subset of the date/time metadata fields, e.g. Adobe Lightroom, Adobe Photoshop Elements, etc.
Brief description: Microsoft Windows batch file that calls exiftool and exiftool arguments file. This utility equalizes/matches/synchronizes date/time metadata across all relevant JPG, CR2 and XMP file metadata fields.
Full description: A utility to distribute a master date/time across all date/time metadata fields in all relevant photo files. This utility was created to solve the challenge that Adobe Lightroom's "edit capture time" does not write the updated capture date/time to all date/time metadata fields in all relevant files.
lr-datetime-equalize utility batch file documentation:
rem * This batch file processes all xmp, cr2 and jpg files in a directory and its subdirectories.
rem
rem * This batch file requires the parameter file lr-datetime-equalize.args for data field mapping.
rem
rem * Put this batch file and the lr-datetime-equalize.args file in the directory with the files you
rem wish to process.
rem
rem * This batch file processes Canon CR2 (RAW) files first, then JPG files.
rem
rem * If you wish to use this utility for non-Canon RAW files, edit the file name extension CR2 and cr2
rem below to your applicable RAW filetype extension, e.g., NEF.
rem
rem * To see more detail about the operations performed, add a -v to the exiftool command lines below.
rem The level of detail increases with each of the following increments of the variable:
rem -v, -v0, -v1, -v2, -v3, -v4, -v5
rem
rem * This batch file requires an installed copy of ExifTool by Phil Harvey.
rem
rem * Download the ExifTool windows command line version and rename the file exiftool.exe.
rem
rem * Place the exiftool.exe file in your windows directory or on your system path.
lr-datetime-equalize utility ExifTool arguments file documentation:
# Notes: * This arguments file sets the master (canonical) source metadata field for date/time
# data as: XMP-xmp:CreateDate
#
# * The XMP-xmp:CreateDate field was chosen as master because Adobe Lightroom changes the
# XMP-xmp:CreateDate field in both RAW sidecar XMP files and standalone JPG files when
# the "Menu: Metadata : Edit capture time" is used.
#
# * If you use a different photo organizing / editing application, you may want or need
# to choose a different master date/time field. You can change the master date/time
# field in the metadata date/time field mappings below.
#
# * All date/time fields of all relevant photo files are set to match the value in the
# master source XMP-xmp:CreateDate field.
#
# * The MetadataDate field is set to the current date and time that the utility executes.
#
# * RAW files' CR2 and sidecar JPG and XMP files' date/time metadata fields are
# populated from the XMP file's XMP-xmp:CreateDate metadata field.
#
# RAW files Example:
# 1. sample.cr2
# 2. sample.jpg
# 3. sample.xmp
# Each set of RAW files are treated as a unit. All date/time fields in each RAW file
# unit are populated with the value in the XMP-xmp:CreateDate field in their .xmp file.
# The date/time meta data fields in sample.cr2 and sample.jpg are populated with
# the date/time value in the XMP-xmp:CreateDate field in sample.xmp.
# All other date/time meta data fields in sample.xmp are populated with
# the value in the XMP-xmp:CreateDate field in sample.xmp.
#
# * JPG files' date/time metadata fields are populated from their XMP-xmp:CreateDate
# field.
#
# JPG file example:
# 1. sample-two.jpg
# Each JPG file is treated as a single source of date/time information for that file
# and that file alone.
# In this example, all date/time fields for sample-two.jpg are populated with the date
# from the XMP-xmp:CreateDate field in sample-two.jpg.
#
#
# * If you wish to drive the master date/time from another field other than
# XMP-xmp:CreateDate field, edit the parameters below.
#
# * The batch file that calls this arguments file processes Canon CR2 (RAW) files first, then JPG files.
#
# * This process populates all datetime fields in all file types: CR2, JPG and XMP
#
# * If you wish to use this utility for non-Canon RAW files, edit the batch file to change the filename
# extension CR2 and cr2 to your applicable RAW filetype extension, e.g., NEF. You may also need to change the
# MakerNotes:TimeStamp tag in this arguments file to match your RAW file metadata tag name.
#
# * To exclude a date/time metadata field from being populated, edit this file and place a # in the first column
# the relevent mapping line. For example, by default, the tiff:DateTime field mapping is disabled by a #.
Code / command line: lr-datetime-equalizeThe required files, lr-datetime-equalize.bat and lr-datetime-equalize.args, are included as a .zip file attached to this post.
Caveats/limitations:
- Windows OS (tested on Windows 7/64)
- Built to process JPG, XMP and Canon CR2 files. Requires editing of batch file for different RAW file types.
- The argurments file sets the master (canonical) source metadata field for date/time data as: XMP-xmp:CreateDate
- RAW files' CR2 and sidecar JPG and XMP files' date/time metadata fields are populated from the XMP file's XMP-xmp:CreateDate metadata field.
- JPG files' date/time metadata fields are populated from their XMP-xmp:CreateDate field.
- When used with photo organizing / editing applications, requires the user to write metadata to photo files prior to use and read metadata from photo files after use.
NewbieNotes (specific notes for newbies explaining basic concepts, caveats, etc.): This utility makes use of a Windows batch file to display information to the user and to control the execution of ExifTool. The batch file contains several useful batch file commands and parameters that you can copy and use in your own batch file, including:
- Comments used to document the batch file
- Controlling the display of information
- Capturing and displaying the current date and time
- Capturing and displaying the current working directory
- Pausing the batch file and waiting for user input
- Display of warning messages and instructions on how to abort the utility
- Piping of the detailed output of the ExifTool operations into a text tile that can be opened for later review and analysis
This utility also uses an ExifTool arguments file to provide the mapping of the source and target date/time metadata fields. The arguments file can be used as a template for your own projects.
Note that in the ExifTool command line in the Windows batch file the current working directory is specified with a single period "." character.
Keywords: Adobe, Adobe Lightroom, date, time, date/time, photo sort, photo display order, change date, sychronize dates, match dates, fix date/time, fix date, fix time
Additional information: Photo Metadata overview: http://www.hackneys.com/travel/docs/metadataoverview.pdf
Excel spreadsheet detailing photo metadata date/time fields and Adobe Lightroom date/time metadata fields: http://www.hackneys.com/travel/docs/photo-metadata-datetime.xls
[edit: added caveat info and wordsmithing; current version; link to XL spreadsheet of photo date/time info]
[PH: changed subject and Tags-->Keywords and attached required files]