ExifTool Forum

ExifTool => Newbies => Topic started by: nikmgl on June 27, 2022, 04:51:43 AM

Title: Is it possible to add missing <CreateDate> tag?
Post by: nikmgl on June 27, 2022, 04:51:43 AM
I have been searching the forum but could not quite figure it out.
Here is the result from exiftool -s -time:all on one of the files that I am having problem with.
FileModifyDate                  : 2019:05:31 10:48:27+03:00
FileAccessDate                  : 2022:06:27 11:41:12+03:00
FileCreateDate                  : 2020:07:11 11:23:10+03:00
ModifyDate                      : 2019:05:31 10:48:15
GPSTimeStamp                    : 07:48:15
GPSDateStamp                    : 2019:05:31
GPSDateTime                     : 2019:05:31 07:48:15Z


I am guessing this image file does not contain <CreateDate> tag. As I am moving/sorting all of my photos using <CreateDate> tag, I want to add it to the files that are missing this tag. Is it possible?
Title: Re: Is it possible to add missing <CreateDate> tag?
Post by: StarGeek on June 27, 2022, 10:53:50 AM
Yes you can.  The very basic command would be to directly set it
exiftool -CreateDate="2022:06:27 12:00:00" /path/to/files/

But hopefully one of the existing time stamps will be what you want.  From that output, it looks the ModifyDate might be the one you want to copy from.
exiftool "-CreateDate<ModifyDate" /path/to/files/

These commands creates backup files.  Add -Overwrite_Original (https://exiftool.org/exiftool_pod.html#overwrite_original) to suppress the creation of backup files.  Add -r (https://exiftool.org/exiftool_pod.html#r-.--recurse) to recurse into subdirectories.
Title: Re: Is it possible to add missing <CreateDate> tag?
Post by: nikmgl on June 28, 2022, 01:41:52 AM
Thank you @StarGeek.

I should have mentioned it in my OP, sorry. When I try  -CreateDate<ModifyDate or -DateTimeOriginal<ModifyDate I get following error:
no writable tags set from ./
Title: Re: Is it possible to add missing <CreateDate> tag?
Post by: StarGeek on June 28, 2022, 10:45:29 AM
What is the exact command and output.  Copy/paste the command and output here and use the Code Button (https://exiftool.org/forum/index.php?topic=4888.msg69111#msg69111) to format it.  Also, is there any pertinent data, such as running the command from a batch/script, as well as the OS and shell you're using.

Otherwise, all I can say is that it works here
C:\>exiftool -time:all -G -a -s y:\!temp\Test4.jpg
[File]          FileModifyDate                  : 2020:07:11 01:23:10-07:00
[File]          FileAccessDate                  : 2022:06:28 07:41:16-07:00
[File]          FileCreateDate                  : 2021:09:07 07:41:30-07:00
[EXIF]          ModifyDate                      : 2019:05:31 10:48:15
[EXIF]          GPSTimeStamp                    : 07:48:15
[EXIF]          GPSDateStamp                    : 2019:05:31
[XMP]           GPSDateTime                     : 2019:05:31 07:48:15Z
[Composite]     GPSDateTime                     : 2019:05:31 07:48:15Z

C:\>exiftool -P -overwrite_original "-CreateDate<ModifyDate" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -time:all -G -a -s y:\!temp\Test4.jpg
[File]          FileModifyDate                  : 2020:07:11 01:23:10-07:00
[File]          FileAccessDate                  : 2022:06:28 07:41:52-07:00
[File]          FileCreateDate                  : 2021:09:07 07:41:30-07:00
[EXIF]          ModifyDate                      : 2019:05:31 10:48:15
[EXIF]          CreateDate                      : 2019:05:31 10:48:15
[EXIF]          GPSTimeStamp                    : 07:48:15
[EXIF]          GPSDateStamp                    : 2019:05:31
[XMP]           GPSDateTime                     : 2019:05:31 07:48:15Z
[Composite]     GPSDateTime                     : 2019:05:31 07:48:15Z