ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: glennbroadway on November 13, 2015, 09:30:00 AM

Title: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 09:30:00 AM
When scanning old photos in Photoshop I use File Info -> Origin and set the Date Created to the date the photo was taken. I was then using exiftool to copy that bit of data into another tag, so that the photos would show up in order in Lightroom.

exiftool -"DateTimeOriginal>CreateDate" -overwrite_original *.jpg

However, when I do this now I see that there are 'No writable tags'. So, I used this:

exiftool -a -time:all -G file.jpg

...to see what tags are actually being set in Photoshop. Here's what I get (XMP Date Created is the one that changed):

[File]          File Modification Date/Time     : 2015:11:13 12:44:49+00:00
[File]          File Access Date/Time           : 2015:11:13 13:26:00+00:00
[File]          File Inode Change Date/Time     : 2015:11:13 12:44:49+00:00
[EXIF]          Modify Date                     : 2015:11:13 12:44:48
[XMP]           Date Created                    : 1972:01:01
[XMP]           Create Date                     : 2015:11:13 12:37:42Z
[XMP]           Modify Date                     : 2015:11:13 12:44:48Z
[XMP]           Metadata Date                   : 2015:11:13 12:44:48Z
[XMP]           History When                    : 2015:11:13 12:44:48Z
[IPTC]          Date Created                    : 1972:01:01

Why would that original command line not be finding anything now? Perhaps Adobe have altered what it writes? Any help would be greatly appreciated.
Title: Re: Old workflow with CreateDate not working now...
Post by: Phil Harvey on November 13, 2015, 09:43:13 AM
For some reason your files no longer contain DateTimeOriginal.  Photoshop must have changed for some reason.  You'll have to use one of the other available date/time tags.

Technically, EXIF:DateTimeOriginal should be set to when the original photo was taken, and EXIF:CreateDate should be set to the scan date.

- Phil
Title: Re: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 09:51:09 AM
I've just done some more experimenting. Hold fire and I will update soon! Thanks for the speedy reply!
Title: Re: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 10:05:11 AM
When I set that date in photoshop and then open the file in Preview (on a MAC) and inspect the info this is what I get:

EXIF
Date Time Digitized: 13 Nov 2015 12:36:10
Date Time Original: 16 Feb 1971 00:00:00

IPTC
Date Created: 16 Feb 1971
Digital Creation Date: 13 Nov 2015

I've JUST REMEMBERED why I was using exiftool to copy the date from one field to another - I was using an app called exifrenamer to rename the files to the date the photo was taken (with automatic increase in the seconds for files taken on the same day with no minutes/seconds stamp).

Can you think what I should update "DateTimeOriginal>CreateDate" to to get exiftool to copy the right date?

OR exiftool can probably do the file renaming for me - but that was just a bit beyond me when I looked at this before.
Title: Re: Old workflow with CreateDate not working now...
Post by: Phil Harvey on November 13, 2015, 10:12:46 AM
Hi Glenn,

Your original command copied DateTimeOriginal (presumably from EXIF) to CreateDate (creating EXIF:CreateDate and updating XMP:CreateDate if it existed).

Copying XMP:DateCreated to CreateDate doesn't make sense because CreateDate should be the scan date, not the original photo date.  I would do this for your current file:

"-exif:datetimeoriginal<$xmp:datecreated 00:00:00" "-exif:createdate<xmp:createdate"

Note that I have added a dummy time to EXIF:DateTimeOriginal.  Technically, a blank time should be added ("  :  :  "), but practically there are problems having to deal with a missing time value so I have added a zero time instead.

Your exact method of renaming would be a bit tricky with ExifTool, so continuing to use exifrenamer make sense.

- Phil
Title: Re: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 10:33:02 AM
Thanks so much for your help. Alas, even using your new commands, exifrenamer is not managing to use the updated date, but instead just renaming the file to today's date (the day I scanned the pics). I found these two in a text file linked on your site. Would I not be able to use some combination of part of each of them to rename the file?

# Composite rename: DateTimeOriginal + Make tags
exiftool '-filename<${DateTimeOriginal}_${make;tr/ /_/;s/__+/_/g}.%le' -d "%Y%m%dT%H%M%S" photo.jpg
> 20130914T210246_Canon.jpg

[ignoring the Make tags in this one]

# Add a counter for duplicate images
exiftool '-FileName<${DateTimeOriginal}_${Model;tr/ /_/;s/__+/_/g}.%e' -d "%Y%m%dT%H%M%S%%-.c" 20130914T074335_Canon.jpg
> 20130914T171112-0_NIKON_D40.jpg
> 20130914T171112-1_NIKON_D40.jpg

Title: Re: Old workflow with CreateDate not working now...
Post by: Phil Harvey on November 13, 2015, 10:45:23 AM
Hi Glenn,

You said you wanted to increment the seconds for duplicate pictures.  This is a bit tricky to do properly.  But if we can assume that you don't have more than 60 pictures with the same timestamp, it could be done like this:

exiftool "-filename<datetimeoriginal" -d "%Y%m%dT%H%M%%.2c.%%e" DIR

Here I substitute a 2-digit copy number (%%.2c) instead of the seconds (%S).  You can of course change the date/time formatting as required and/or add other tags as in the other examples you posted.

- Phil
Title: Re: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 12:44:57 PM
Many thanks. I want to do the rename (like in your last example) but instead of using datetimeoriginal I need to use one of the two, correctly set dates above (i.e. [XMP] Date Created or [IPTC] Date Created).

Glenns-MBP:Beth glennbroadway$ exiftool -a -time:all -G Scan\ 93.jpg
[File]          File Modification Date/Time     : 2015:11:13 17:30:31+00:00
[File]          File Access Date/Time           : 2015:11:13 17:30:33+00:00
[File]          File Inode Change Date/Time     : 2015:11:13 17:30:31+00:00
[EXIF]          Modify Date                     : 2015:11:13 17:29:37
[EXIF]          Create Date                     : 2015:11:13 11:45:26
[XMP]           Create Date                     : 2015:11:13 11:45:26Z
[XMP]           Modify Date                     : 2015:11:13 17:29:37Z
[XMP]           Metadata Date                   : 2015:11:13 17:29:37Z
[XMP]           Date Created                    : 1971:02:16
[XMP]           History When                    : 2015:11:13 17:28:53Z, 2015:11:13 17:29:37Z
[IPTC]          Date Created                    : 1971:02:16
[ICC_Profile]   Profile Date Time               : 1998:02:09 06:49:00


I just looked at your site, at the list of all the tags, and it seems I can just type datecreated. I tried it and it worked, but there are a couple of problems: I don't think the counter was working.

Glenns-MBP:Pictures glennbroadway$ exiftool "-filename<datecreated" -d "%Y%m%dT%H%M%%.2c.%%e" Beth
Error: 'Beth/1972:01:01' already exists - Beth/Scan 101.jpg
Error: 'Beth/1971:02:16' already exists - Beth/Scan 94.jpg
Error: 'Beth/1971:03:01' already exists - Beth/Scan 96.jpg
Error: 'Beth/1971:03:01' already exists - Beth/Scan 97.jpg
Error: 'Beth/1972:01:01' already exists - Beth/Scan 98.jpg
Error: 'Beth/1971:03:01' already exists - Beth/Scan 99.jpg
    1 directories scanned
    4 image files updated
    6 files weren't updated due to errors


And when I look at the files in the folder, those that have been renamed have colons in them and no file extension.

Glenns-MBP:Beth glennbroadway$ ls
1971:02:16   1972:01:01   Scan 101.jpg   Scan 96.jpg   Scan 98.jpg
1971:03:01   1977:09:01   Scan 94.jpg   Scan 97.jpg   Scan 99.jpg


I feel like I'm not being very helpful here and that I'm using up a lot of your time - I really appreciate it!
Title: Re: Old workflow with CreateDate not working now...
Post by: Phil Harvey on November 13, 2015, 01:02:09 PM
I think that one of the dates with a missing time is causing the problem.  Use a command like this to see the formatting the ExifTool will apply to the date/time values:

exiftool -a -time:all -G -d "%Y%m%dT%H%M%%.2c.%%e" DIR

When I do this with a test file here, I see that IPTC:DateCreated isn't formatted.  So I think that this may solve your problem:

exiftool "-filename<xmp:datecreated" -d "%Y%m%dT%H%M%%.2c.%%e" Beth

I'm guessing that IPTC:DateCreated was taking priority, and if so this should fix things.  (Drop the -a from the first command to see which one takes priority.)

- Phil
Title: Re: Old workflow with CreateDate not working now...
Post by: glennbroadway on November 13, 2015, 03:44:09 PM
Boom! Perfect. And you were right about IPTC taking priority.

Thank you so much for all your help. Out of interest, is the syntax here a standard thing - would I see it used with other command line tools?
Title: Re: Old workflow with CreateDate not working now...
Post by: Phil Harvey on November 15, 2015, 09:52:29 PM
The basic structure of the command line is the same for all command-line applications, but the meanings of the arguments are specific to exiftool.

- Phil