How to find photos/videos that have a time zone?

Started by Tonio, October 19, 2022, 04:45:39 PM

Previous topic - Next topic

Tonio

Hello,

I am sorting all my photos in Photos.app (macOS) and I am having trouble with some of them that don't sort correctly with videos, that means that the timezone is not the good one. They are taken with a Canon 90D: this camera, due to its configuration maybe, adds a timezone in [Canon] tag and [ExifIFD] tag. (Not IFD0, for some weird reason).

The problem is that this timezone is sometimes wrong, I don't know why. Maybe because there is no reason why the Camera would know where I am, as it has no GPS module yet and is not connected to Wi-Fi while outdoor. I use Canon Camera Connect sometimes, that uses the phone GPS but not while taking the photos (this could explain those problems).

But as the photos are already taken, and I have thousands of photos to sort, my question is:
How can I find all the photos/videos that have a timezone with an ExifTool command ?
GraphicConverter 11 can't display only media with a timezone embedded, so I am wondering if there is any ExifTool command to do this. And if ExifTool cannot highlight the photos with a time zone in a folder, can it delete the timezone from the tags mentioned above at the same time? The problem would be solved if the timezone was deleted, because with an old Canon 600D that didn't store the timezone in those tags, there is not problem in sorting the photos and videos.


Thank you very much,

Tonio

Alan Clifford


For my Nikon raws, this would do it

exiftool -r -ext nef -timezone -daylightsavings .

Canon probably has similar makernotes tags.

======== ./Barbados.March/ahc_7910.nef
Time Zone                       : -04:00
Daylight Savings                : No
======== ./Barbados.March/ahc_7907.nef
Time Zone                       : -04:00
Daylight Savings                : No
======== ./Barbados.March/ahc_7909.nef
Time Zone                       : -04:00
Daylight Savings                : No
======== ./Barbados.March/ahc_7908.nef
Time Zone                       : -04:00
Daylight Savings                : No

Tonio

Quote from: Alan Clifford on October 19, 2022, 05:45:29 PMexiftool -r -ext nef -timezone -daylightsavings .
Thank you so much!!!
I would never have figured this out by myself.
By the way, this surprises me that I have to setup a file format in the command. But thanks!!!

Tonio

Tonio

However it doesn't show the timezone embedded in some Canon fields, like IFD0. Can't I take every tag into account with this command?

Thank you

Tonio

Phil Harvey

You can add as many tag names to the command as you want.  Use this command to see all date/time tags and choose the ones that have time zones:

exiftool -a -G1 -s -time:all FILE

- 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 ($).

StarGeek

Most DSLR camera manufacturers have some sort of time zone entry in their proprietary MakerNotes, though the tag names may differ.  Modern phones are starting to put the time zone in the EXIF OffsetTime* tags (OffsetTime/OffsetTimeOriginal/OffsetTimeDigitized.

Most (all?) XMP date/time tags can include a time zone as well.
"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

Tonio

Hello everyone,

Thank you very much for your answer. I think you found the solution. Actually, my goal was to highlight, put in evidence the photos with timezones in a selection of 4000+ photos. The exiftool -ee -r -timezone .
command worked well, because it is really easy to see the ones that have a timezone among the others. It even detects "Suspicious MakerNotes offset for CanonCameraSettings - ./20140425_155113.JPG" sometimes, I don't understand all the warnings but I guess it is useful to find inconsistencies in the pictures.

However, this didn't affect the XMP tags, UserData, Keys, and maybe some more. It only gets the timezone from [ExifIFD] and [Canon] tags, which should be good for me because those tags contain the timezone I need to delete/change but I couldn't have a view on those ones too. So I tried to run:
exiftool -ee -r -timezone -OffSetTime . and it displayed correctly the timezones that didn't appear last time! So that's great, but in each photo (and video) I still have timezone stored in Keys, UserData... that don't show up

Would you know which option I have to use to get all the timezones in each tag?
And finally, I notice that the media are randomly sorted after running the command, even if the media is sorted by date in the folder. Is there a way to display all the files by date in Terminal too?

Thank you very much for your answer,

Tonio

Phil Harvey

Hi Tonio,

Quote from: Tonio on October 20, 2022, 06:36:52 AMIs there a way to display all the files by date in Terminal too?

Add -fileorder5 filemodifydate to the command.

- 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 ($).

wywh

Quote from: Phil Harvey on October 20, 2022, 07:45:34 AM-fileorder5

Is '-fileOrder5 FileName' the same as '-fast5 -fileOrder FileName'?

I have noticed that '-fileOrder FileName' is somewhat slow when I just need input APFS files sorted correctly.

- Matti

Phil Harvey

#9
Hi Matti,

Quote from: wywh on October 20, 2022, 08:25:40 AMIs '-fileOrder5 FileName' the same as '-fast5 -fileOrder FileName'?

No.  Using -fileOrder adds an initial pass of all files to extract the required tags for sorting the files.  -fileOrder5 speeds this initial pass, while -fast5 speeds up the second pass (each pass may obviously require different tags, so you are able to set the fast level for each pass separately).

- Phil

Edit: I'll make this update the documentation to try to clarify this:

         Note that the -fileOrder option can incur large
         performance penalty since it involves an additional initial
         processing pass of all files, but this impact may be reduced by
         specifying a *NUM* to effectively set the -fast level for the
         initial pass.
...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 ($).

Tonio

#10
Hello and thank you for your answer,
Indeed it works. Do you have an idea why the command is scanning each file twice? https://ibb.co/MfWvRb3


And unfortunately, I still can't get the timezone from [UserData] and [Keys] tags in videos :'(
This is why, as you can see on the picture, no timezone is displayed except for videos containing the timezone in [Canon].
Any help on how to remove ONLY the timezone from this [Canon] tag would be really appreciated, because on my 90D some videos have the wrong timezone saved in it, and I don't know how to edit/add any timezone in this tag so I prefer to remove it so each video doesn't store any timezone here.

BUT if you have a solution to copy the timezone from Keys or UserData and insert it into Canon tags, it would be even better!!!

Thank you very much for all your information

Tonio

Phil Harvey

Hi Tonio,

The "._" files are the Mac resources -- you may see these when using MacOS with a non-MacOS disk volume.  Add -i HIDDEN to ignore these files, eg:

exiftool -i HIDDEN ...

- 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 ($).

Tonio

Great, thank you!!

Would you know why I get this error each time?
"Error: File not found - —r"
https://ibb.co/b14FyMT

Thank you

wywh

Quote from: Tonio on October 19, 2022, 04:45:39 PMtimezone in [Canon] tag

I guess it is not currently possible to edit those proprietary G0 MakerNotes. In my setup they produce no problems so I just ignore them.

exiftool -a -G1 -s -api QuickTimeUTC=1 -Time:All 2020-0101-1200-00_canon6d.mov
[System]        FileModifyDate                  : 2020:01:01 12:00:00+02:00
[System]        FileAccessDate                  : 2022:10:01 18:03:46+03:00
[System]        FileInodeChangeDate             : 2022:10:20 17:44:05+03:00
[QuickTime]     CreateDate                      : 2020:01:01 12:00:00+02:00
[QuickTime]     ModifyDate                      : 2020:01:01 12:00:00+02:00
[Track1]        TrackCreateDate                 : 2020:01:01 12:00:00+02:00
[Track1]        TrackModifyDate                 : 2020:01:01 12:00:00+02:00
[Track1]        MediaCreateDate                 : 2020:01:01 12:00:00+02:00
[Track1]        MediaModifyDate                 : 2020:01:01 12:00:00+02:00
[Track2]        TrackCreateDate                 : 2020:01:01 12:00:00+02:00
[Track2]        TrackModifyDate                 : 2020:01:01 12:00:00+02:00
[Track2]        MediaCreateDate                 : 2020:01:01 12:00:00+02:00
[Track2]        MediaModifyDate                 : 2020:01:01 12:00:00+02:00
[Track3]        TrackCreateDate                 : 2020:01:01 12:00:00+02:00
[Track3]        TrackModifyDate                 : 2020:01:01 12:00:00+02:00
[Track3]        MediaCreateDate                 : 2020:01:01 12:00:00+02:00
[Track3]        MediaModifyDate                 : 2020:01:01 12:00:00+02:00
[Keys]          LocationDate                    : 2015:08:08 13:03:06+03:00
[IFD0]          ModifyDate                      : 2015:08:08 13:02:57
[ExifIFD]       DateTimeOriginal                : 2015:08:08 13:02:57
[ExifIFD]       CreateDate                      : 2015:08:08 13:02:57
[Canon]         TimeZone                        : +03:00
[Canon]         TimeZoneCity                    : Cairo
[Canon]         DaylightSavings                 : On
[ExifIFD]       SubSecTime                      : 55
[ExifIFD]       SubSecTimeOriginal              : 55
[ExifIFD]       SubSecTimeDigitized             : 55
[Composite]     SubSecCreateDate                : 2015:08:08 13:02:57.55
[Composite]     SubSecDateTimeOriginal          : 2015:08:08 13:02:57.55
[Composite]     SubSecModifyDate                : 2015:08:08 13:02:57.55

exiftool -Canon:TimeZone= 2020-0101-1200-00_canon6d.mov                      
Warning: Can't delete Permanent tag Canon:TimeZone
Nothing to do.

exiftool -a -G0 -s -api QuickTimeUTC=1 -Canon:TimeZone 2020-0101-1200-00_canon6d.mov
[MakerNotes]    TimeZone                        : +03:00

- Matti

Tonio

#14
Hello,

Okay, thank you for your answer. Actually I was able to edit the timezone if present but not to add it when the field was missing.
You can try, the command you gave me works fine to do it
exiftool -ThumbnailImage -b file | exiftool -time:all='YYYY:MM:JJ hh:mm:ss' -timezone='+XX:xx' -wm w - | exiftool -ThumbnailImage'<=-' -wm w file
Anyone knows how to get rid of this error "Error: File not found - —r"
when running the command exiftool -i HIDDEN -ee -r -timezone -OffSetTime -fileorder5 filemodifydate .?

Thank you


EDIT: the problem seems to be solved by removing -r option. Weird, but my work is done now! Thank you all!