batch transforming portion of titles into EXIF Date Created?

Started by gkphotography, January 19, 2011, 01:24:37 PM

Previous topic - Next topic

gkphotography

Hi, folks--

Is it possible for me to batch process files using ExifToolGUI such that I can take a portion of the title of my images and rewrite that in my EXIF Date Created section?

For example, I have a file named 20080603_211330_614012_2838b where the first two sections of numbers represent YYYYMMDD_HHMMSS.  I'd like a script (or somethign) to take that value and overwrite the existing Date Created data in the corresponding EXIF.

I know I can do this one image at a time, but I'm looking for a script to batch out a couple thousand of these at once.

Any help would be appreciated.

Thanks!

-Greg

Phil Harvey

This is easy since the date/time values in the filename are already in the correct sequence.  On the command line this can be accomplished with a "-createdate<filename" argument. 

From ExifTool GUI I believe you may be able to do this with the exiftool direct feature.

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

BogdanH

Yes, I've just tried and this command can be executed by using Exiftool direct button (before executing, you need to seelect all files you wish to modify, of course).
Added: or you select none of files and specify directory in command.
I'm not sure how long would it take to modify thousands of files.. so you better try with smaller amount first.

However, I didn't expect ExifTool would recognize DateTime value in such filenames (that's why I said "just tried") -thank you for helping on this, Phil.

Bogdan

gkphotography

Thanks, guys!

One little problem, though...  I'm doing all this because I'm trying to get Apple iTunes to correctly sync my photos so they're all in chronological order according to the name of the photos.  As it seems iTunes does not sort based on title, I thought I could do it by Creation Date.  However, after running the EXIFtool Direct, it's still not sorting properly (though the tool worked perfectly).  Thus, I'm left to assume that iTunes sorts based on Date Modified.  I tried changing the command line to "-modifydate<filename" but quickly realized that I was doing it wrong.

Any change either of you has experience with iTunes and can help me out here?

Thanks again for all your help so far.  I really appreciate it!

-Greg

Phil Harvey

You could try setting the FileModifyDate tag (same argument, just swap "CreateDate" for "FileModifyDate").  This isn't embedded metadata, but instead is the filesystem modification date/time.  ExifTool has the ability to set this too, just like the metadata tags.  It could be that this is what iTunes is using.

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

Phil Harvey

Hi Bogdan,

Quote from: BogdanH on January 19, 2011, 02:09:59 PM
I didn't expect ExifTool would recognize DateTime value in such filenames (that's why I said "just tried") -thank you for helping on this, Phil.

ExifTool is quite flexible about the format of date/time values (as it is with GPS coordinates).  It comes in very handy in cases like this.

I should probably document this somewhere.  Maybe I'll add a note to FAQ number 5.

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

gkphotography

Thanks, Phil, but...

...the plot thickens.

So, Apple is really being annoying about this.  But to my latest questions:

1) Can I bulk change multiple values at one time?  I find I'm having to use EXIF Tool Direct multiple times with each pass.

2) Further, it won't do more than about 600 photos at once.  If I try to do more than that, it just stops working.  Can I somehow highlight all images, no matter how many, and have it process them?

3) Can I input a non-entry for an entry?  In other words, I'd like to erase ALL metadata entirely from the images (these are test copies and my originals are safe elsewhere).  I want every single darned field in EXIF, IPTC, and XMP to be absolutely blank.  Can this be done?

4) Is there a list somewhere of all the commands I can run through the EXIF Tool Direct?

Thanks yet again!

-Greg

Phil Harvey

Hi Greg,

Quote from: gkphotography on January 20, 2011, 03:08:20 AM
1) Can I bulk change multiple values at one time?  I find I'm having to use EXIF Tool Direct multiple times with each pass.

Yes.  Bogdan explained how in his last post.

Quote
2) Further, it won't do more than about 600 photos at once.  If I try to do more than that, it just stops working.  Can I somehow highlight all images, no matter how many, and have it process them?

There is no limit from the command-line side.  Maybe Bogdan knows if this is a problem with the GUI.

Quote
3) Can I input a non-entry for an entry?  In other words, I'd like to erase ALL metadata entirely from the images (these are test copies and my originals are safe elsewhere).  I want every single darned field in EXIF, IPTC, and XMP to be absolutely blank.  Can this be done?

The argument is -all=

Quote
4) Is there a list somewhere of all the commands I can run through the EXIF Tool Direct?

The list is endless, but you will find a number of examples here.

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

BogdanH

Hi,

1. Changing multiple values at one time... I assume you mean changin mora than just one tag in batch? If that's the question, then you can do something like that:
"-createdate<filename" -Artist="My Name" *.jpg
-this will write DateTime (as explained before) and at the same time write "My Name" into all jpg files.

2. Is there a limit of files when using ExifTool direct button?
No. However I must admit never trying out several thousand files at once. IMO, when working on large amount of files, using wildcards for filenames (as in example above) is the easiest/shortest way to go.

3. Removing all metadata
Phil explained that. In GUI, there's also menu Modify>Remove metadata which can do the same for all selected files.

4. Knowing all commands and variations of them
Phil gave you a link. I would add, there's no point (that is, it's impossible for me) to learn all of them. When I realized this, I decided to make GUI. For special cases, I still need to lurk into ExifTool documentation.

Bogdan

Phil Harvey

Quote from: BogdanH on January 20, 2011, 11:41:09 AM
1. Changing multiple values at one time... I assume you mean changin mora than just one tag in batch?

Ooops.  I misread this.  Thanks for clarifying, Bogdan.  I was thinking of multiple files, not multiple tags.

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