ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Mac2 on September 13, 2013, 01:18:24 PM

Title: -P (preserve) not working with overwrite_original?
Post by: Mac2 on September 13, 2013, 01:18:24 PM
According to the docs

QuotePreserve the filesystem modification date/time of the original file (FileModifyDate) when writing. Note that some filesystems store a creation date which is not preserved by this option, with the exception of Windows systems where Win32API::File::Time is available. For other systems, the -overwrite_original_in_place option may be used if necessary to preserve the creation date.

I use exiftool.exe on Windows.

When I include

-overwrite_original
-P


in my args file, the last modified date and time of the file on disk changes. My understanding is that it should not, because of -P.

Note: I avoid using -overwrite_original_in_place because it is much slower for large files than overwrite_original.
Title: Re: -P (preserve) not working with overwrite_original?
Post by: Phil Harvey on September 13, 2013, 01:55:17 PM
Odd.  I get this (on a Mac, but it should be the same in Windows, using "dir" instead of "ls -l"):

> ls -l a.jpg
-rw-r--r--  1 phil  staff  2379022 Sep 13 09:15 a.jpg
> exiftool a.jpg -artist=me -P
    1 image files updated
> ls -l a.jpg
-rw-r--r--  1 phil  staff  2379022 Sep 13 09:15 a.jpg
> exiftool a.jpg -artist=me -P -overwrite_original
    1 image files updated
> ls -l a.jpg
-rw-r--r--  1 phil  staff  2379022 Sep 13 09:15 a.jpg
> exiftool a.jpg -artist=me
    1 image files updated
> ls -l a.jpg
-rw-r--r--  1 phil  staff  2379022 Sep 13 13:57 a.jpg


- Phil
Title: Re: -P (preserve) not working with overwrite_original?
Post by: Mac2 on September 14, 2013, 09:35:33 AM
Hi, Phil

you're right. My error, sorry.

The problem was not caused by the args file I looked at, but by a secondary set of arguments run later to re-import IPTC and EXIF. The second args file did not add the -P parameter when requested.