ExifTool Forum

ExifTool => Newbies => Topic started by: Jom on October 15, 2019, 09:42:57 PM

Title: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 15, 2019, 09:42:57 PM
Hello.

If I execute this command,
exiftool -progress: -progress -overwrite_original -r "-EXIF:DateTimeOriginal<FILE:FileCreateDate" -EXIF:OffsetTimeOriginal="+03:00" *
I lose the original value of FILE:FileCreateDate and get the updated one.

How to keep value of FILE:FileCreateDate?

Thanks.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: StarGeek on October 15, 2019, 09:50:12 PM
FileCreateDate should not be changed under Windows, though FileModifyDate will.  I don't know why it's happening in your case.  But try using the -overwrite_original_in_place option (https://exiftool.org/exiftool_pod.html#overwrite_original_in_place).
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 15, 2019, 10:33:34 PM
QuoteFileCreateDate should not be changed under Windows, though FileModifyDate will.  I don't know why it's happening in your case.

This is because ExifTool actually creates a new file and only then reads FILE:FileCreateDate from it to copy this data to the EXIF:DateTimeOriginal tag.
I think so.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 15, 2019, 10:48:19 PM
Quote from: StarGeek on October 15, 2019, 09:50:12 PM
But try using the -overwrite_original_in_place option (https://exiftool.org/exiftool_pod.html#overwrite_original_in_place).

No effect.

-P (-preserve) — that doesn't fit either.
QuoteNote that some filesystems store a creation date (Windows FileCreateDate or Mac MDItemFSCreationDate) which is not affected by this option.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Phil Harvey on October 16, 2019, 07:26:13 AM
I assume you're running Windows.  Here is what I get under Windows 10:

(https://exiftool.org/forum/index.php?action=dlattach;topic=10521.0;attach=3303)

- Phil

Edit:  Changed commands to use FileCreateDate instead of FileModifyDate
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 16, 2019, 11:20:45 AM
Yes, it Windows 10.
These are screen shots by Lightshot that do not have EXIF data about the date and time of shooting.

(https://exiftool.org/forum/index.php?action=dlattach;topic=10521.0;attach=3299)

I can't use FileModifyDate because It is different from FileCreateDate in some files.

(https://exiftool.org/forum/index.php?action=dlattach;topic=10521.0;attach=3301)

I need to save exactly FILE:FileCreateDate in EXIF:DateTimeOriginal.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Phil Harvey on October 16, 2019, 12:03:51 PM
Sorry, I used FileModifyDate instead of FileCreateDate in my last post.  I've edited the post to fix this now.  The result is the same.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: StarGeek on October 16, 2019, 12:36:30 PM
What file system is being used on the drive (NTFS, FAT)?

What is the output of
exiftool -ver -v
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 16, 2019, 01:22:26 PM
Quote from: StarGeek on October 16, 2019, 12:36:30 PM
What file system is being used on the drive (NTFS, FAT)?

What is the output of
exiftool -ver -v

NTFS

(https://exiftool.org/forum/index.php?action=dlattach;topic=10521.0;attach=3305)
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: StarGeek on October 16, 2019, 01:34:06 PM
Is the file on a local drive or a network drive?

Any background service running that might be touching the files will exiftool is running, such as an automatic backup program?

Other than that, I'm out of ideas.
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 16, 2019, 01:40:23 PM
Quote from: StarGeek on October 16, 2019, 01:34:06 PM
Is the file on a local drive or a network drive?

Any background service running that might be touching the files will exiftool is running, such as an automatic backup program?

Local drive.
There are no such background services.

exiftool -progress: -progress -r -P "-EXIF:DateTimeOriginal<FILE:FileCreateDate" "-EXIF:OffsetTimeOriginal<FILE:FileCreateDate" *.png

It works, but I have questions. I'm to doing research...
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: StarGeek on October 16, 2019, 02:04:20 PM
In case you didn't know, wildcards don't work with the-r (recurse) option (https://exiftool.org/exiftool_pod.html#r-.--recurse).  If you want to recurse and limit the scope to a specific file type, use the -ext (extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension).

Your command should be (using the dot to indicate the current directory)
exiftool -progress: -progress -r -P "-EXIF:DateTimeOriginal<FILE:FileCreateDate" "-EXIF:OffsetTimeOriginal<FILE:FileCreateDate" -ext png .
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 17, 2019, 12:09:54 AM
wildcards = *.png?
You mean r (recurse) option doesn't work with *.png, but it works with the -ext png .?
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Phil Harvey on October 17, 2019, 07:06:30 AM
Yes.

Just think about it:  If you specify *.png, then you aren't specifying any directory names, so there is nothing to recurse into.

- Phil
Title: Re: How to keep value of FILE:FileCreateDate?
Post by: Jom on October 17, 2019, 12:17:41 PM
Thanks, I just wanted to eliminate the assumption that files will recursively search in the root automatically.