GeorgeC
GeorgeC

Reputation: 1037

Use Exiftools to add a tag with spaces and special characters to an image file

When I compare a file that uploads correctly (into Mapillary) and a jpg file that fails in EXIFTOOLS I see that it doesn't have Create Date, Date/Time Original and Modify Date. There are lots of other fields as well but these are the only ones dealing with time.

enter image description here

When I try to use

'.\exiftool(-k).exe' -"Date/Time Original"="2019:10:27 18:14:10.5" Photo_2019_Jul_12_13_38_40_019.jpg

It doesn't let me add the tag (I assume) because it has a '/' in it. It also doesn't allow "Create Date" for example. enter image description here

How can I create a tag with these?

Some sample files are in https://drive.google.com/drive/folders/1QCQdSvdk0RygfCqqRWaOj-IzBbj17gax?usp=sharing

Upvotes: 2

Views: 3361

Answers (1)

StarGeek
StarGeek

Reputation: 5771

See ExifTool FAQ #2

"Date/Time Original" isn't the tag name, it's the tag description, which can change depending upon the set language (see the -lang option). Tag names don't have spaces or special characters. The actual tag name to set a value is DateTimeOriginal.

So your command should be
.\exiftool(-k).exe -DateTimeOriginal="2019:10:27 18:14:10.5" Photo_2019_Jul_12_13_38_40_019.jpg

Though take note that DateTimeOriginal doesn't hold a subsecond value. The location for that would be SubSecTimeOriginal. But exiftool does have a shortcut. If you set SubSecDateTimeOriginal, it will set the DateTimeOriginal and SubSecTimeOriginal tags. Also, if you add a time zone to the end of that, it will set OffsetTimeOriginal, where the time zone value is held.

For example:
.\exiftool(-k).exe -SubSecDateTimeOriginal="2019:10:27 18:14:10.5-04:00" Photo_2019_Jul_12_13_38_40_019.jpg

Upvotes: 7

Related Questions