ExifTool Forum

ExifTool => Newbies => Topic started by: remarkableearth on December 20, 2017, 11:59:01 AM

Title: What exactly is this error about the CreateDate format telling me?
Post by: remarkableearth on December 20, 2017, 11:59:01 AM
I'm writing values to a set of tags, some of which are custom and some not, using something similar to exiftool -r -customtag1=value1 -createdate=- -customtag2=value2 /dir/subdir . to which I receive the message Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:CreateDate (PrintConvInv)
    2 directories scanned
   20 image files updated


I saw that Phil had responded to another similar question with
Quote from: Phil Harvey on May 01, 2014, 08:53:09 AM
Your commands aren't working because you want to copy the value from another tag (with "<") instead of assign a value ("=").

Also, you should take advantage of the Composite GPSDateTime tag for this (that is what it is for):

exiftool -if "not defined $DateTimeOriginal" "-datetimeoriginal<gpsdatetime" ...

And setting FileModifyDate won't work the way you are doing it because DateTimeOriginal doesn't exist.  Instead, you must set this the same way that you did with DateTimeOriginal.

- Phil

Using this advice I tried exiftool -if "not defined $CreateDate" "-createdate<gpsdatetime" /dir/subdir . and got a lengthy response with a few dozen warnings similar to Warning: No writable tags set from /dir/subdir/image1.JPG
Warning: No writable tags set from /dir/subdir/image2.JPG
Warning: [minor] Possibly incorrect maker notes offsets (fix by 36?) - /dir/subdir/image3.jpg
Warning: [minor] Suspicious MakerNotes offset for tag 0x9001 - /dir/subdir/image3.jpg
Warning: No writable tags set from /dir/subdir/image3.jpg


So I don't think my interpretation of Phil's suggestion worked well, however, the CreateDate value is written accurately; I checked it against that of the original file.

So I just need a little tutoring on what the original error message is about.
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: StarGeek on December 20, 2017, 12:09:04 PM
You tried to set a timestamp (CreateDate) to the value of a dash -.  The dash is not a date or a time, which is why you get a response of Invalid date/time.
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: remarkableearth on December 20, 2017, 12:41:10 PM
I used a dash as a placeholder value because my next step replaces the dash with the EXIF -CreateDate data and outputs to a csv, where I will be adjusting values on a record-by-record basis in my research. Is there a different way to write a placeholder for the -CreateDate tag such that I can then replace it with the EXIF data?
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: Phil Harvey on December 20, 2017, 12:45:55 PM
You could do this if you really want to write a dash: -createdate#=-

The "#" bypasses the date/time formatting.

- Phil
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: remarkableearth on December 20, 2017, 01:23:46 PM
Phil, when I do as you suggest the value for -CreateDate becomes a dash and I lose the datestamp data. Is there a way you can suggest that doesn't overwrite the original datestamp data but enables me to gather it along with my custom tags & values for csv output?

The workflow I've been using for several weeks has been working just fine (gather my custom tags, write their values and gather some of the file's tags and values (as described in the first line of my original post on this conversation) and output all of them to a csv), but has the annoying but seemingly inconsequential error message. Is it inconsequential?
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: Phil Harvey on December 20, 2017, 03:10:59 PM
I thought you wanted to set CreateDate to "-" for some reason.  If you don't want to do this, then remove the -createdate=- from your command and the warning will go away.

- Phil
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: remarkableearth on December 20, 2017, 03:26:25 PM
Phil, you solved it. I mistakenly thought I had to include the -createdate=- tag in my writing of tags when I only needed to read it. Thank you. Always a big help.
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: Phil Harvey on December 20, 2017, 09:17:39 PM
I'm interested to know why you thought that CreateDate would be written when you were only assigning values to CustomTag1 and CustomTag2.  And if you thought CreateDate would be written, why didn't you think that any of the other 10000 or so available tags wasn't being written as well?  And finally, why you thought that -createdate=- would stop it from being written?

If some documentation or example was misleading to you, I should fix it.

- Phil
Title: Re: What exactly is this error about the CreateDate format telling me?
Post by: remarkableearth on December 22, 2017, 01:28:32 PM
I don't think my misuse of exiftool commands arose from unclear documentation but rather from misunderstanding of the rules of individual commands to the broader context, as you suggest in your questions. Still learning.