Missing "Date taken" in EXIF

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

Post Reply
Tommes
Posts: 14
Joined: Wed Dec 23, 2020 5:29 pm

Missing "Date taken" in EXIF

Post by Tommes »

Hello,

I hope someone can help me.
I have found nothing for my problem in the forum.

I have many photos in different subfolders.
Some of them have no "Date taken" Tag.

First question: Can I find these photos through a filter?
When I have found them: Can I set the Date Taken-Tag from the filename?
User avatar
michel038
XnThusiast
Posts: 1468
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Missing "Date taken" in EXIF

Post by michel038 »

First question: Can I find these photos through a filter?
An idea would be to sort photos by 'date taken' :
- View, view files in subfolders.
- View, view as, details
- View , Sort by , Date taken
... so you can select a set at the top or the bottom of the list
When I have found them: Can I set the Date Taken-Tag from the filename?
XnViewMp can modify exif dates only by copying existing dates...
Sometimes "file modification date" is a good source , you can use it in Tools, Change timestamp
(while you are using details view, file modify date can be seen)

If no date is available, you can use Exiftool
- Tools, Open with, configure programs, Add
browse, to reach and open "AddOn" folder in Xnviewmp folder , and select exiftool
- in the new line , double click in first column to name your new entry, such as Name2Date
-in the right column, parameters, add something like this -k "-exif:dateTaken<filename" but I think it will be more difficult to build the correct parmeter for exiftool. If i have enough free time, i'll try to add information here, else you can ask for help in exiftool forum ...
What is the format of your file names ?

When the correct params will be set, you will select photos, right-click, open with, Name2Date ...
You can try it on a single test photo for now ...
User avatar
michel038
XnThusiast
Posts: 1468
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Missing "Date taken" in EXIF

Post by michel038 »

This man is a genius :shock: . Phil Harvey is the creator of ExifTool.
I processed many filenames formats containing dates with this simple parameter: -k "-AllDates<filename" -overwrite_original
In most cases, I get a warning, but the work is well done
Exif dates and file dates are updated with the file name. ("AllDates" is only for exif dates. )
Even Whatsapp filenames become exif dates !
20201225_WA0002 wil get 2020/12/25 00:02:00 time stamp
( only numbers are significant, dates must contain at least : year 4 digits , month 2 digits, day 2 digits )

- Be careful with overwrite_original parameter :
For first sessions, do no use it, and you will get a backup of each processed file with _original extension... You can delete _original files later.
-XnViewMP does not always refresh the displayed dates : go to another folder, and come back in the folder you want to check ...

P.S. For my Android device, I need to update also file modify date.
I had to use this parameter -k -P -m "-AllDates<Filename" "-FileModifyDate<Filename" -overwrite_original
Tommes
Posts: 14
Joined: Wed Dec 23, 2020 5:29 pm

Re: Missing "Date taken" in EXIF

Post by Tommes »

michel038 wrote: Fri Dec 25, 2020 11:37 pm This man is a genius :shock: . Phil Harvey is the creator of ExifTool.
I processed many filenames formats containing dates with this simple parameter: -k "-AllDates<filename" -overwrite_original
In most cases, I get a warning, but the work is well done
Exif dates and file dates are updated with the file name. ("AllDates" is only for exif dates. )
Even Whatsapp filenames become exif dates !
20201225_WA0002 wil get 2020/12/25 00:02:00 time stamp
( only numbers are significant, dates must contain at least : year 4 digits , month 2 digits, day 2 digits )

- Be careful with overwrite_original parameter :
For first sessions, do no use it, and you will get a backup of each processed file with _original extension... You can delete _original files later.
-XnViewMP does not always refresh the displayed dates : go to another folder, and come back in the folder you want to check ...

P.S. For my Android device, I need to update also file modify date.
I had to use this parameter -k -P -m "-AllDates<Filename" "-FileModifyDate<Filename" -overwrite_original
I tested this, but nothing happens to the testfile.
The file is named "20201225_test.jpg"
When I renamed the file in "202012251904_test.jpg" (for hour and minute) it works.

So far so good...
but my photos in YYYYMMDD_xxx format. Whitout hour and minute.... what can i do?
User avatar
michel038
XnThusiast
Posts: 1468
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Missing "Date taken" in EXIF

Post by michel038 »

Yes, I noticed the same thing this afternoon, exiftool needs 4 digits for hhmm ...

If your filenames ( _xxx) does not contain any digit, you can first use Tools, Batch rename in XnviewMP to add an arbitrary timestamp
In the first field, set {filename}_#### This will add four digits
Then you can set "start" at 0 --- > for 00h 00min
or start at 1200 --- > For 12h 00min
..And step =1 to add 1 min on each photo ... or not

Check displayed results in the same window before clicking OK ...

Now exiftool will be able to create correct exif date, but time stamp will be artificial.
Post Reply