ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: tunucu on August 06, 2017, 04:40:44 PM

Title: Handling .aee files
Post by: tunucu on August 06, 2017, 04:40:44 PM
Hi -

I rename all picture and movie files taken via my iphone to something like YYYY-mm-dd_hh-MM-ss.* using:
$Exiftool -progress -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext jpg -ext PNG -fixbase

Problem is that Apple has .aee files for edited files. If I use the command above it renames all files but then I lose the association to .aee files.

I tried to workaround the problem by creating a script that finds .aee files, and then the associated .jpg and .mov files, and then rename them all at once to match the new name.

This works OK but then I would like to pass that directory name to above command to rename remaining files. What happens is that, it adds a -1 to file names which are already renamed to above naming format.

For example:
img-1234.jpg, img-1234.mov, img-1234.aee are 3 files all belonging to the same instance. when I use my script I get 3 files:
2017-06-06_14-00-00.jpg
2017-06-06_14-00-00.mov
2017-06-06_14-00-00.aee

If I know run the command above, I get two additional files
2017-06-06_14-00-00-1.jpg
2017-06-06_14-00-00-1.mov
but of course no corresponding .aee.

Ideally, I don't want these additional files as they are already renamed.
I know this is a long shot but Exiftool is so versatile that I thought I would ask. Is there any way for me to tell it somehow not to touch files that are already matching the target naming convention when I specify a directory to process?
Title: Re: Handling .aee files
Post by: Stephen Marsh on August 06, 2017, 09:18:12 PM
Perhaps you could move the "set of 3" processed files to a sub-folder, then exclude (-i or -ignore) the subfolder from processing?

... -i '/Users/currentuser/Desktop/parent/child' '/Users/currentuser/Desktop/parent'

Which would exclude the folder named "child" while recursively processing the top level folder named "parent" (and any other child folders not explicitly ignored).
Title: Re: Handling .aee files
Post by: Phil Harvey on August 07, 2017, 09:14:39 AM
You could first rename the aee files using DateTimeOriginal from the jpg files:

exiftool -progress -recurse -tagsfromfile %d%f.jpg "-FileCreateDate<DateTimeOriginal#" "-FileModifyDate<DateTimeOriginal#" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext aee

Here I have also disabled the conversion for the dates copied to other dates.  Although in this case it isn't a problem, it could be if you changed the date/time formatting.

- Phil
Title: Re: Handling .aee files
Post by: tunucu on August 07, 2017, 09:53:47 PM
Phil,
OK, first I did not realize that I could process .aae files similar to others.
You comment also made me realize that although my intention was to fix FileCreate date as well as rename, I did not mean to use the formatting for both, just for rename!
Thank you for warning!

The problem is that Apple creates these files for every time there is some edit. So possibilities are
1) .jpg & .aae
2) .jpg & .mov & .aae
3) .mov & .aae

So, I shot a slow motion and edited a file to come up with a solution.
If I just copytagsfrom %d%f.jpg, using DateTimeOriginal that leaves #3 out
If I also copytagsfrom %d%f.mov, using CreateTime that solves #3. I could not test #2 use case but I am assuming that this will work, b/c file would be renamed already at this point.

Thanks again!

Title: Re: Handling .aee files
Post by: Phil Harvey on August 08, 2017, 07:24:55 AM
You could try this:

exiftool -progress -recurse -tagsfromfile %d%f.mov "-FileCreateDate<CreateDate#" "-FileModifyDate< CreateDate#" "-FileName<CreateDate" -tagsfromfile %d%f.jpg "-FileCreateDate<DateTimeOriginal#" "-FileModifyDate<DateTimeOriginal#" "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" $FullPath -ext aee

This command will take the information from the .jpg if it exists, otherwise from the .mov

- Phil
Title: Re: Handling .aee files
Post by: tunucu on August 08, 2017, 08:22:59 PM
Exactly what I was looking for, thank you very much, Phil!
Title: Re: Handling .aee files
Post by: ejm554 on August 30, 2018, 01:28:36 AM
I came across this old discussion today. If I'm not mistaken, there's a significant typo that could cause confusion or errors.

The "AEE" sidecar files discussed herein are probably "AAE" sidecars. In other words, the second letter of the file extension should be an A, not an E.

Anyone looking back at this thread may want to keep this in mind, especially if copying the suggested code.
Title: Re: Handling .aee files
Post by: Phil Harvey on August 30, 2018, 06:26:06 AM
Could you post a .aae file (or email me one - philharvey66 at gmail.com) so I can have a sample?

- Phil
Title: Re: Handling .aee files
Post by: Hayo Baan on August 30, 2018, 02:29:26 PM
Sent you an example.
Title: Re: Handling .aee files
Post by: Phil Harvey on August 30, 2018, 10:10:10 PM
Thanks!
Title: Re: Handling .aee files
Post by: Phil Harvey on August 31, 2018, 07:43:37 AM
This file is PLIST format.  I'll add read support for this.

- Phil