Using "if" condition for renaming and executing other commands

Started by Jan, March 11, 2022, 07:27:40 AM

Previous topic - Next topic

Jan

Here it is:

Original file
[File]          FileModifyDate                  : 2022:01:14 06:53:40+07:00
[File]          FileAccessDate                  : 2022:06:05 21:37:47+07:00
[File]          FileCreateDate                  : 2022:01:18 15:39:03+07:00
[EXIF]          ModifyDate                      : 2022:01:14 06:53:41
[XMP]           CreateDate                      : 2022:01:14 06:53:41.27
[EXIF]          DateTimeOriginal                : 2022:01:14 06:53:41
[EXIF]          CreateDate                      : 2022:01:14 06:53:41
[MakerNotes]    TimeZone                        : +07:00
[MakerNotes]    DaylightSavings                 : No
[MakerNotes]    DateDisplayFormat               : D/M/Y
[MakerNotes]    PowerUpTime                     : 2022:01:13 18:32:12
[EXIF]          SubSecTime                      : 27
[EXIF]          SubSecTimeOriginal              : 27
[EXIF]          SubSecTimeDigitized             : 27
[EXIF]          DateTimeOriginal                : 2022:01:14 06:53:41
[Composite]     SubSecCreateDate                : 2022:01:14 06:53:41.27
[Composite]     SubSecDateTimeOriginal          : 2022:01:14 06:53:41.27
[Composite]     SubSecModifyDate                : 2022:01:14 06:53:41.27



Renamed file
[File]          FileModifyDate                  : 2022:01:14 06:58:08+07:00
[File]          FileAccessDate                  : 2022:06:05 21:29:34+07:00
[File]          FileCreateDate                  : 2022:03:13 10:06:08+07:00
[EXIF]          ModifyDate                      : 2022:01:14 06:58:08
[XMP]           CreateDate                      : 2022:01:14 06:58:08.37
[EXIF]          DateTimeOriginal                : 2022:03:13 10:06:08
[EXIF]          CreateDate                      : 2022:01:14 06:58:08
[MakerNotes]    TimeZone                        : +07:00
[MakerNotes]    DaylightSavings                 : No
[MakerNotes]    DateDisplayFormat               : D/M/Y
[MakerNotes]    PowerUpTime                     : 2022:01:13 18:32:12
[EXIF]          SubSecTime                      : 37
[EXIF]          SubSecTimeOriginal              : 37
[EXIF]          SubSecTimeDigitized             : 37
[Composite]     SubSecCreateDate                : 2022:01:14 06:58:08.37
[Composite]     SubSecDateTimeOriginal          : 2022:03:13 10:06:08.37
[Composite]     SubSecModifyDate                : 2022:01:14 06:58:08.37


StarGeek

I'm not sure what to say.  The -P (-preserve) option should keep the  FileModifyDate  the same, and the FileCreateDate should not change at all.  But the FileModifyDate changes by a few minutes between your output.  And it doesn't change to the current date, it just changes a few minutes from the original date.  This is extremely weird.

All I can suggest at this point is to break down the workflow and commands into individual steps, on the command line not in a bat file, changing only one item at a time.  Then compare the output between each step to figure out what is happening.  Try to narrow down exactly when things change.

The only other thing I can suggest is after all the commands have been run, copy the correct times from the file into the system time stamps.  Something like
exiftool "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" /path/to/files/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Jan

Hi StarGeek,
Thank you for your help and advice.
Going to do as you said, break the commands down and see what happens.
As you said those changes there are definitely weird.
Jan

Jan

Looks like I found the source of that problem, the command "-EXIF:DateTimeOriginal<FILE:FileCreateDate"
in the original script was overwritting those DateTimeOriginal and SubSecDateTimeOriginal tags