Main Menu

Date/Time Questions

Started by neil40, February 09, 2017, 10:51:20 AM

Previous topic - Next topic

neil40

I have some questions about the correct tag to alter/write, when writing location data to images from a camera without GPS.

I am using Geosetter to add the co-ordinates of my pictures from a trip to New England last fall (I am from the UK)

I would like advise on which time I would set on the pictures, given that the New England area (Boston etc) is -5 hours from GMT.
There appear to be several times if I look at (for example) from my iPhone using the command exiftool -a -G1 -s FILE such as
FileModifyDate
FileAccessDate
FileCreateDate
DateTimeOriginal
CreateDate
GPSDateTime
SubSecCreateDate
SubSecDateTimeOriginal

My time is obviously set on the camera, and I originally forgot to set the time adjustment, so I'll need to adjust those to a USA time to sequence properly with the later ones.

I also took some pictures on my iPhone, which adjusts automatically to local time, but the confusion here, looking at the data is that it has set a 'local' time but doesn't appear to show any time zone difference. For example, these are all the times set and extracted using the above exiftool command, from a picture taken at 16:37 in a Boston hotel, when we just arrived in the room.
[System]        FileModifyDate                  : 2016:10:29 04:24:25+01:00
[System]        FileAccessDate                  : 2017:02:09 14:53:27+00:00
[System]        FileCreateDate                  : 2017:02:09 14:53:27+00:00
[IFD0]            ModifyDate                       : 2016:10:08 16:37:58
[ExifIFD]         DateTimeOriginal              : 2016:10:08 16:37:58
[ExifIFD]         CreateDate                       : 2016:10:08 16:37:58
[Composite]    SubSecCreateDate             : 2016:10:08 16:37:58.277
[Composite]    SubSecDateTimeOriginal    : 2016:10:08 16:37:58.277

I would welcome views on this. I'd quite like all my pictures from this trip to somehow indicate I was -5 hours from 'home' in the UK?

Phil Harvey

Hi Neil,

There are new time zone tags added to the EXIF 2.31 specification that your camera isn't writing.  You could write them with these two commands:

exiftool -if "$make =~ /apple/i" -offsettimeoriginal="-05:00" -offsettimedigitized="-05:00" DIR

exiftool -if "$make !~ /apple/i" -offsettimeoriginal="+00:00" -offsettimedigitized="+00:00" DIR

The first command sets your iPhone images to a timezone of -05:00, and the second sets the time zone for your camera images.

After doing this you should be able to accurately geotag with ExifTool using this command:

exiftool -geotag TRACK.LOG "-geotime<subsecdatetimeoriginal" DIR

This requires ExifTool 10.28 or later for the new EXIF time offset tags.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Alternately, you could correct the camera images to the Boston timezone with this command:

exiftool -if "$make !~ /apple/i" -datetimeoriginal-=5 -createdate-=5 -offsettimeoriginal="-05:00" -offsettimedigitized="-05:00" DIR
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

neil40

#3
Quote from: Phil Harvey on February 09, 2017, 11:14:25 AM
Hi Neil,

There are new time zone tags added to the EXIF 2.31 specification that your camera isn't writing.  You could write them with these two commands:

exiftool -if "$make =~ /apple/i" -offsettimeoriginal="-05:00" -offsettimedigitized="-05:00" DIR
Many thanks again Phil
I keep the iPhone pictures in a separate directory (I have 3 - iPhone/JPG/RAF) and got the following result:
Quote1 directories scanned
    6 files failed condition
  360 image files updated

I know 4 of the files that failed, which are downloaded pictures, but can I amend the command to tell me which ones fail?
[Edit] possibly the -v option?
I thought I read somewhere that you can run the exiftool commands as a test, IE it doesn't change anything, but cannot find where I read the example!

Phil Harvey

Quote from: neil40 on February 10, 2017, 04:36:40 AM
can I amend the command to tell me which ones fail?
[Edit] possibly the -v option?

Yes.  -v  Or you can look in the directory and the failed ones would be the ones without a "_original" copy. (or see my command below)

QuoteI thought I read somewhere that you can run the exiftool commands as a test, IE it doesn't change anything, but cannot find where I read the example!

Nope.  There is no dry-run mode.  However, this command will allow you to see the files that would fail the condition:

exiftool -if "$make !~ /apple/i" -filename DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

neil40

Quote from: Phil Harvey on February 10, 2017, 07:11:15 AM
Nope.  There is no dry-run mode.  However, this command will allow you to see the files that would fail the condition:
How bizarre! I could swear I read somewhere it was something like exiftool -testfile or exiftool -tempfile !! Hey-ho!!

Phil Harvey

Yes, there is a "TestFile" tag that you can write as a sort of dry run when renaming files (instead of writing FileName), but nothing for what you want to do.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

neil40


neil40

Quote from: Phil Harvey on February 10, 2017, 07:11:15 AM

exiftool -if "$make !~ /apple/i" -filename DIR
Thanks for this one, it identified the two pictures from my phone that failed the main command to change the time in them.
Bizarrely, it seems they failed as they have no 'iPhone' information in them. Definitely from my phone, but they differ in a lot of ways to the others in terms of EXIF information.
No idea why they have it missing, but I fixed the time difference individually.

Thanks once again.