Setting creation dates and partial dates for Adobe Lightroom 4

Started by clyde, April 03, 2012, 02:14:34 AM

Previous topic - Next topic

clyde

I started playing around with Lightroom 4, and I was excited to import scans of my dad's old slides and clean them up. They can finally have metadata parity with new images coming off my GPS-enabled digital camera. One of the first things I noticed is Lightroom thinks these images were all made in 2008, when I scanned them. It apparently picked that from the filesystem modification time. I tried fixing the date in Lightroom, but its metadata handling is flaky in some places. Meanwhile it's ExifTool to the rescue.

So I have a bunch of images with no metadata aside from a color profile. I have partial dates for the original slides in the path names. I started here http://www.exiftool.org/faq.html#Q5 but had two problems. "-alldates" doesn't add the non-standard fields that Lightroom is looking for; and my naming conventions aren't clean enough for "<filename". Here is the recipe I came up with:

exiftool -r -overwrite_original_in_place \
                "-CreateDate<FileModifyDate" \
                "-ModifyDate<FileModifyDate" \
        "-XMP-xmp:CreateDate<FileModifyDate" \
        "-XMP-xmp:ModifyDate<FileModifyDate" \
           -DateTimeOriginal="1980:00:00 00:00:00" \
           -IPTC:DateCreated="1980:00:00" \
  -XMP-photoshop:DateCreated="1980" \
/path/to/files


For each directory, I tweak the dates by hand then paste the whole thing into the terminal. It's ugly, but it works. I'm working off this table http://www.exiftool.org/TagNames/MWG.html for the meaning of the standard tags. "<FileModifyDate" worked well enough for the date the scans were made. Others may want to cheat and copy DateTimeOriginal to those as well. Note that if you run this twice on the same file FileModifyDate will have changed, and it will blow away the original CreateDate on the second pass. The backslashes are there to allow multiple lines in the terminal.

The XMP and IPTC tags are created by Lightroom. It doesn't get them all right unless I spoon-feed each value. In fact it will only pick it all up reliably on a fresh import. If I put a complete timestamp in DateTimeOriginal, it will display that--but it's not editable. It displays XMP-xmp:ModifyDate as "Date Time", also not editable. XMP-photoshop:DateCreated populates "Date Created", the only editable field in Lightroom. That one will take a timestamp of any length, whereas the others need zeroes to be valid. When I edit "Date Created" and save metadata, Lightroom copies it out to both XMP-photoshop:DateCreated and IPTC:DateCreated, but sadly not the others. Perhaps most important, the Library Filter panel has a "Date" filter which uses DateTimeOriginal; and the smart collections "Capture Date" filter uses DateTimeOriginal--which is not editable. Like I said, it's best to get it all straight before importing to Lightroom.

Hope this helps someone. Here are a couple more examples with formatting for longer datestamps.

exiftool -r -overwrite_original_in_place \
                "-CreateDate<FileModifyDate" \
                "-ModifyDate<FileModifyDate" \
        "-XMP-xmp:CreateDate<FileModifyDate" \
        "-XMP-xmp:ModifyDate<FileModifyDate" \
           -DateTimeOriginal="1980:07:00 00:00:00" \
           -IPTC:DateCreated="1980:07:00" \
  -XMP-photoshop:DateCreated="1980:07" \
/path/to/files


exiftool -r -overwrite_original_in_place \
                "-CreateDate<FileModifyDate" \
                "-ModifyDate<FileModifyDate" \
        "-XMP-xmp:CreateDate<FileModifyDate" \
        "-XMP-xmp:ModifyDate<FileModifyDate" \
           -DateTimeOriginal="1980:07:15 00:00:00" \
           -IPTC:DateCreated="1980:07:15" \
  -XMP-photoshop:DateCreated="1980:07:15" \
/path/to/files


Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

clyde

Correction: DateTimeOriginal is editable in Lightroom. The "Metadata>Edit Capture Time" menu option brings up a dialog box with a few options for editing the full timestamp. It won't accept truncated timestamps, without month or day. According to the docs, Lightroom assumes that "Date Time Original and Date Time Digitized are the same". That makes sense for digital-camera images. It writes the following tags to the image, a little different from when I tried adding only a date to "Date Created":

ExifIFD:DateTimeOriginal
XMP-photoshop:DateCreated
IPTC:DateCreated
IPTC:TimeCreated
Composite:DateTimeCreated