Dates: exif and file

Started by tomczak, March 05, 2011, 12:40:11 PM

Previous topic - Next topic

Phil Harvey

The quotes only need to be used if the argument contains special characters (like space, >, <, |, and maybe some others, depending on your system).

The order of the arguments is not very important for what you are doing.  The problem is that it must be done as 2 separate commands:

1) exiftool "-AllDates+=0:50" -overwrite_original ImageFolder

2) exiftool "-DateTimeOriginal>FileModifyDate" ImageFolder

You don't need -overwrite_original for the 2nd command because it doesn't modify any "real" tags in the file, so a backup isn't created.

Note that these 2 commands may be combined into a single command line, but this is a more advanced technique:

exiftool "-AllDates+=0:50" -overwrite_original -execute "-DateTimeOriginal>FileModifyDate" -common_args ImageFolder

- 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 ($).

JanK

Thanks!

Parameters which belongs to an argument have to be separated by it's own line or by -execute.
I read something about "-execute" in your documentation.

You missed the "ImageFolder" at the end of the first command. When I write some more camands (you mean this with "-common_args" I think) do I have to write -execute before each argument ?

For example:
exiftool -argument1 -parameterTo1 -execute -argument2 -parameterTo2 -execute -argument3 -parameterTo3 ...

Is this done as complete separate tasks? Meaning that argument2 is applied on the output of argument1 and argument 3 on the output of argument2?

Thanks Jan
-Mac OSX Mountain Lion-

Phil Harvey

Hi Jan,

Quote from: JanK on August 09, 2011, 01:49:32 AM
You missed the "ImageFolder" at the end of the first command.

No I didn't, but I did forget that you are using an argument file.  The -common_args option applies all subsequent arguments to all commands on the line, but it can not be used inside an argument file.  So in this case the command would look like:

exiftool -@ my.args -common_args ImageFolder

witht this "my.args" file:

-AllDates+=0:50
-overwrite_original
-execute
-DateTimeOriginal>FileModifyDate


QuoteWhen I write some more camands (you mean this with "-common_args" I think) do I have to write -execute before each argument ?

You use -execute after all options for a command if you want to begin another command on the same command line.  You must specify a source file for each command, but the -common-args option gives you a way to specify the same source file(s) for all commands at once.

These are effectively executed as separate tasks.  In my previous post, the two techniques will have identical effects.

- 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 ($).

JanK

Hi,

we talked about the "creation date" of the filesystem and that Exiftool only shows the "File Modification Date" which belongs to the filesystem and not the "creation Date" because it is not available on any operation system. I have MacOSX and so I have a "creation date".

For a better view I will change the "creation date" of my pictures as well but there are some inconsistencies.

For now I will describe what I did:
I have pictures from three different cameras of an event.
I change the time of some camera collection with exiftool '-AllDates+=0:03' -overwrite_original DIR to match the same timeline of the other cameras.
I renamed all pictures in order to the "datetimeoriginal".
I change the file modification Date to the DateTimeOriginal with exiftool '-DateTimeOriginal>FileModifyDate' DIR

In MacOSX Finder the Dates "FileModifyDate" and also the "CreationDate", are updated to the DateTimeOriginal. This happen for two of three cameras. At the third camera the CreationDate is not changed.

  • I thought with the described command I will change the FileModifyDate only. Why is the CreationDate also changed?
  • And why has the CreationDate of one camera not touched. It is shown the same date as before. "01.01.1970 ; 01.00" I know this is the starting date of chronology from computers. So it could be that there is no CreationDate available for this camera files and so it is shown the first available date. But when the others are updated to the same date as the FileModifyDate, why aren't these dates updated too
-Mac OSX Mountain Lion-

Phil Harvey

Quote from: JanK on October 25, 2011, 05:34:00 PM
1. I thought with the described command I will change the FileModifyDate only. Why is the CreationDate also changed?

The filesystem creation date should have been reset to the current date by your '-AllDates+=0:03' command.  Just setting FileModifyDate should not change this because this doesn't involve rewriting the file.

You must use -overwrite_original_in_place if you want to preserve the filesystem creation date when writing any real tags to the file.

Quote2. And why has the CreationDate of one camera not touched.

This would happen if there were no dates to change with '-AllDates+=0:03'.

- 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 ($).

JanK

QuoteThe filesystem creation date should have been reset to the current date by your '-AllDates+=0:03' command.
Yes I Can confirm that. All dates in Finder are set to the current date.

When I change a real tag it is the "AllDates" command. Because of this it is not needed to preserve the Create Date. The old CreateDate is wrong (belongs to no real date with which I can do something) And the CreateDate of the day on which I apply the AllDates command is also not very usefull. Don't understand me wrong, I will change the CreateDate.  So after applying AllDates I use exiftool '-DateTimeOriginal>FileModifyDate' DIR to set the FileModifyDate to the DateTimeOriginal. With this the CreationDate in Finder is also changed to the DateTimeOriginal.

1. This is great for me. But I want to know if this is a intentional function because the command says "FileModificationDate" and not CreationDate.

Now I know why this do not work with some files. These files have no CreationDate because I coppyed it from other filesystem and did not change a real tag with "AllDates" (The Dates were ok so I don't have to change them).

2. Is there a way to get a CreationDate for these files without changing a tag in the file? Without that I have the CreationDate 1970 shown in Finder(meaning there is no creationDate).
-Mac OSX Mountain Lion-

Phil Harvey

When I write FileModifyDate on my Mac and look at the date/times with SPLAT-I in the finder, the "Modified" date changes, but the "Created" date does not.  (OSX 10.7.2)  I don't understand why you are apparently seeing a different behaviour.

I don't know how to set the filesystem creation date.

- 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 ($).

JanK

#22
This is confusing.
With all my files the CreateDate is changed when I use FileModifyDate.

System
Mac OSX 10.7.2
Exiftool 8.68

Example: A file copyed from a CD. You see it has no Create date. It also works with files that already have a create date but I will show the effect of no CreateDate too.

Translation:
Erstellt = Create
Geändert = Modified
Zul. Geöffnet = Last open


1. The dates of the file before starting. Same are shown with commandd-I.


2. I applyed exiftool '-DateTimeOriginal>FileModifyDate' '1.jpg' Nothing happen to CreateDate because at this time no CreateDate exists. I did it only to show the non effecting to CreateDate when there is no existing CreateDate (1970)


3. I applyed exiftools '-AllDates+=0:10:00'  '1.jpg' You can see that there is a CreateDate generated of the current time and all dates are changed to the current time too. (You explain this) For now the file has a create date.


4. After applying exiftool '-DateTimeOriginal>FileModifyDate' '1.jpg' you can see that an existing CreateDate is changed. With your description the Erstellt = Create should still be "Heute 19:43" from step 3.


And you can't confirm this?
-Mac OSX Mountain Lion-

Phil Harvey

I confirm this.

The reason is that you are trying to set a modification date that is before the creation date.  It seems that the MacOS doesn't like this inconsistency so it changes the creation date too, but only in this case.

Interesting.

If Windows does this too, it gives me a technique for setting the filesystem creation date.

I'll do some testing.  If we get lucky, maybe I can add the ability to write the creation date.  I hadn't thought of this before.  That would be fantastic if it works!

Thanks for providing these details.

- 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 ($).

JanK

Hi Phil,

do you have some informations about your testing? Maybe a built in function in "AllDates" to rewrite the CreationDate as well? Also for files with no modification date before the creation date.
Maybe it could check if there is a existing creation date, if not generate it with for example changing the DateTimeOriginal one minute backward and next one minute forward. Now the CreationDate should be the current time. (I don't know what happen to files which already have a creation date. I think it will not be effected. So there is an other way needed.) When there is no CreationDate it is no problem. Changing any date will set the CreationDate to the current date and so DateTimeOriginal>FileModifyDate will change the CurrentDate as well.
-Mac OSX Mountain Lion-

Phil Harvey

Yes, I can set the filesystem creation date indirectly through these steps:

1) rewrite the file (causes filesystem modification and creation dates to be set to the current date/time).

2) set the filesystem modification date to what I want for the creation date.  (This will update both the modification and creation dates.)

3) set the filesystem modification date to some later date.

So this can be done, but unfortunately requires rewriting the file.  I haven't yet tested this to see if it works in Windows.  One big downside is that even though I have a round-about way to effect the creation date, I still have no way to read it.  So even if I implement this it would be a write-only tag.  Adding this to the AllDates shortcut would not be appropriate.

- 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 ($).

JanK

I will do step 1 and 2. Then I changed all dates to the correct one. I am not interesting in Windows anymore so I can't test it because I have none.

Is there a problem with rewriting the file? Why is this unfortunately? You won't change any data in the file I think.

Is there some tag to rewrite the file without changing anything? Setting time forward and backward is a bit circuitous.

Do you think it is a problem when it is write only? When I change the dates of a jpg I will always change all dates. Exceptionally the Create Date. Everyone associate the Create Date with the Date on which the photo was taken. So it is a very important that this date is the DateTimeOriginal. So for me it is not needed that I can read the Create Date. Or better for a function to change every date it is not needed.

Maybe not "AllDates" but "TrulyAllDates" ;)
-Mac OSX Mountain Lion-

Phil Harvey

Quote from: JanK on November 14, 2011, 04:25:22 PM
Is there a problem with rewriting the file? Why is this unfortunately? You won't change any data in the file I think.

You're right, I don't need to change the file.  But it would be a lot faster if I didn't have to rewrite it.

Quote
Is there some tag to rewrite the file without changing anything?

Currently, no.

QuoteDo you think it is a problem when it is write only?

It is difficult to verify that it was written properly if you can't read it.  Also, people won't know they can change it if they don't see it in the ExifTool output.

QuoteMaybe not "AllDates" but "TrulyAllDates" ;)

Yes, AllDates isn't really all of them.  There are many, many other date/time values in other types of metadata that this won't write, some of which ExifTool doesn't even have the ability to write.  So there never will be a TrulyAllDates tag that you can write.

- 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

I just tested this on Windows, and unfortunately it doesn't work as it does in OS X.  So I can't use this trick to add a writable "FileCreationDate" pseudo-tag to ExifTool. :(

- 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 ($).

JanK

Typically Windows! It destroys any good idea.
I set the DateTimeOriginal +1Minute and -1Minute and then DateTimeOriginal>FileModifyDate
That works great an OSX!
-Mac OSX Mountain Lion-