EXIF data - date taken not correct?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
myrnalarson
Posts: 68
Joined: 29 Apr 2011 16:46

EXIF data - date taken not correct?

Post by myrnalarson »

I want to remove the date the photo was taken from my image files. I don't see a way to do that in XYPlorer, so I've used Windows Explorer and/or Adobe bridge.

Adobe Bridge tells me that this field is blank for all files. DirOpus says the same thing.

I've added that column to a special view in XYPlorer, and there I still see a date. Usually it's the date the file was created, which is not the same as the date the photo was taken.

Is this a bug? Can you fix it?

Would you consider adding the ability to edit EXIF data to XYPlorer, just as you can change the date created, modified, or accessed?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: EXIF data - date taken not correct?

Post by highend »

I've added that column to a special view in XYPlorer, and there I still see a date
Show screenshots for:
- The column definition you've added
- F12, "Meta" tab for one of the files that show a date in that column
Would you consider adding the ability to edit EXIF data to XYPlorer
Already wished (but a bit hidden):
viewtopic.php?f=5&t=13087
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: EXIF data - date taken not correct?

Post by admin »

FYI, EXIF data usually contain at least three different dates related to the creation/modification of the photo. XYplorer uses a fallback strategy to give you at least one of those dates.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: EXIF data - date taken not correct?

Post by highend »

A way to do it (without the need for Windows Explorer / Adobe Bridge):

exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/)

You need the windows executable! (http://www.sno.phy.queensu.ca/~phil/exi ... -10.25.zip)

Extract it
Adapt the path in the following script for $exiftool
Go to the folder that contains all your images
Execute the script

It will remove all three EXIF dates from all files and store them in the new subfolder "modified"

Code: Select all

    $newFolder = "<curpath>\modified/";
    $exiftool = "D:\Tools\@Command Line Tools\exiftool\exiftool(-k).exe";
    run """$exiftool"" -k -o ""$newFolder"" -ModifyDate= -CreateDate= -DateTimeOriginal= ""<curpath>""";
One of my scripts helped you out? Please donate via Paypal

myrnalarson
Posts: 68
Joined: 29 Apr 2011 16:46

Re: EXIF data - date taken not correct?

Post by myrnalarson »

highend wrote:
I've added that column to a special view in XYPlorer, and there I still see a date
Show screenshots for:
- The column definition you've added
- F12, "Meta" tab for one of the files that show a date in that column
Would you consider adding the ability to edit EXIF data to XYPlorer
Already wished (but a bit hidden):
viewtopic.php?f=5&t=13087
Here are 2 screen shots, as requested. 1st shows the column definition, i.e. Date Taken; 2nd shows the file display with metadata pane open below. For the 1st file, the file display has a date in the Date Taken column, but the metadata shows it as blank. Note that the displayed date does not match any of the 3 file dates (created, modified, accessed).

If I ask to see the Date Taken, I don't want to see something else substituted when that EXIF data field is blank. I want to KNOW that it's blank.

Here's the reason for this is: I have images on my iPod/iPad. When I do a slideshow, I want to see them in random order, but Apple insists on displaying them in order by Date Taken. I'm assuming that if all files have no date (or the same date), Apple will sort them alphabetically by name.

So I've (laboriously!!!) removed the Date Taken, then, in XYPlorer, sorted the files in random order, then used Rename Batch mode to add a numeric prefix.
To see the attached files, you need to log into the forum.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: EXIF data - date taken not correct?

Post by highend »

It seems even when you try to use a custom column with a script:

Code: Select all

return property("System.Photo.DateTaken", <cc_item>);
The fallback system from XY is used.

There is one thing you could do:
- Use exiv2 (http://www.exiv2.org/index.html) -> exiftool ist just too slow...
- Use a custom column with a script

Setup for the custom column:

Code: Select all

Caption: DateTaken
Type: Script

Script:
    $result = runret("""D:\Tools\@Command Line Tools\exiv2\exiv2.exe"" -Pv -q -g Exif.Photo.DateTimeOriginal ""<cc_item>""");
    $date = replace(gettoken($result, 1, " "), ":", ".");
    return replace($date . " " . gettoken($result, 2, " "), <crlf>);

Format: Text
Trigger: Browse / List
Item type: Files
Item filter: jpg
Ofc you need to adapt the path for exiv2 for your system!

There is a "fmt" switch for exiv2 but I didn't find out how to spit out the date with "." instead of ":" so I made the adjustment in the XY script...

If trigger: "Browse" is too slow, use "List" instead...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: EXIF data - date taken not correct?

Post by admin »

Checked the code. I have to correct my previous air statement somewhat:

XYplorer, in the "Special Property" column field "Date Taken", uses only two of the three dates: the preferred data is "Exif DateTimeOriginal", if that's not available it attempts to use "Exif DateTime". The third date "Exif DateTimeDigitized" is not used at all in XYplorer.

Note that you can check all Exif data (RAW) by using this undocumented scripting command. e.g. the three photo creation dates:

Code: Select all

echo get("exif", 0x0132); //Exif DateTime (RAW data)
echo get("exif", 0x9003); //Exif DateTimeOriginal (RAW data)
echo get("exif", 0x9004); //Exif DateTimeDigitized (RAW data)
Note that XYplorer, in the "Property" (NOT "special") column field "Date Taken" used the shell property "Date Taken" which should be identical to the results of this scripting line:

Code: Select all

echo property("System.Photo.DateTaken");  //should be identical to "Exif DateTimeOriginal" (processed data), but less precise (discarding the seconds)
BTW, property("System.Photo.DateTaken") does NOT used XYplorer's fallback strategy, so if this command returns a value, then either the value exists in the file, or the shell has its own fallback strategy.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: EXIF data - date taken not correct?

Post by highend »

BTW, property("System.Photo.DateTaken") does NOT used XYplorer's fallback strategy, so if this command returns a value, then either the value exists in the file, or the shell has its own fallback strategy.
It has it's own fallback strategy. It uses "Exif DateTimeDigitized" when "Exif DateTimeOriginal" does not exist. Never trust MS^^
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: EXIF data - date taken not correct?

Post by admin »

Really?! Sigh.

At least, we can make a special column just to check whether exif 9003 is there or not:
To see the attached files, you need to log into the forum.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: EXIF data - date taken not correct?

Post by highend »

That's great :)

You can use it to get e.g. gps locations like:

Code: Select all

0x0001 = Exif.GPSInfo.GPSLatitudeRef  (North / South)
0x0002 = Exif.GPSInfo.GPSLatitude     (Values)
0x0003 = Exif.GPSInfo.GPSLongitudeRef (East / West)
0x0004 = Exif.GPSInfo.GPSLongitude    (Values)
Ofc Latitude + Longitude would need a bit of formating (because of their raw data type)
One of my scripts helped you out? Please donate via Paypal

myrnalarson
Posts: 68
Joined: 29 Apr 2011 16:46

Re: EXIF data - date taken not correct?

Post by myrnalarson »

admin wrote:FYI, EXIF data usually contain at least three different dates related to the creation/modification of the photo. XYplorer uses a fallback strategy to give you at least one of those dates.
So the only way to get the data I want, i.e. the information that DateTaken is empty, is via a script?

To describe this negatively, the strategy is 'if the data that's requested isn't available, give the user some other data and don't bother to tell them about the substitution'. Is this 'fall back strategy' documented, i.e. that the 'DateTaken' column may not really be DateTaken? You don't do it that way in the Metadata pane.

I don't like this approach at all, but maybe I'm alone in that opinion. Anyway, my solution getting the answer to "Is DateTaken" blank? to ask it in DirOpus or Adobe Bridge. I'd rather do it in XYPlorer! I may try one of the scripts. Thanks for those examples, particularly the one in which the script is set up as a column definition.

PS: In any case, there seems to be a bug in XYPlorer. Look at my screen dumps -- items 15 and 29 show a blank in the 'Date Taken' column, the other files show a date. Adobe Bridge and Windows File Explorer say they are all blank.

If you want to track this down, I can tell you where that erroneous date is coming from: first I had changed all the DateTaken entries to 7/1/2016, then changed them all to 7/16/2016 (or maybe it was in the reverse order). Then I decided the best strategy is to clear the DateTaken field, and I did that. The previous date, 7/1 or 7/16, is what you are displaying. So where is it stored?

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: EXIF data - date taken not correct?

Post by admin »

Note that your task is rather unusual. Most users are happy if they get the correct data regardless from which field the data is extracted. You instead want to confirm that a certain field is empty. I showed here how it can be done quite easily: viewtopic.php?p=140988#p140988

Concerning the potential bug you mention: Could you send me that file for testing?

myrnalarson
Posts: 68
Joined: 29 Apr 2011 16:46

Re: EXIF data - date taken not correct?

Post by myrnalarson »

admin wrote:Note that your task is rather unusual. Most users are happy if they get the correct data regardless from which field the data is extracted. You instead want to confirm that a certain field is empty. I showed here how it can be done quite easily: viewtopic.php?p=140988#p140988

Concerning the potential bug you mention: Could you send me that file for testing?
I don't consider it to be 'the correct data'. I have removed the DateTaken information.

For example, let's say a person took photos on 8/10, but his camera date was set to 8/5. He's now corrected the EXIF data to show the real date, 8/10. Is XYPlorer going to show 8/5, because that's what the camera 'thought' the date was when he clicked the shutter?

Which file do you want? One where XYP shows it incorrectly (metadata says blank, column has a date), or one where it shows correctly (metadata and column are both blank)?

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: EXIF data - date taken not correct?

Post by admin »

Please send me one where XY shows incorrect data.

myrnalarson
Posts: 68
Joined: 29 Apr 2011 16:46

Re: EXIF data - date taken not correct?

Post by myrnalarson »

#244# Yeats Caedmon.jpg
admin wrote:Please send me one where XY shows incorrect data.
File attached. I don't know where the "DateTaken" column is coming from. For all the files in which I've tried to delete the date taken, the time is 00:00. For this one, it's a date in 2010, with a time. This is a scan of an LP jacket (I've been converting my LPs to CDs, and creating a booklet and disk label from that scant). The date shown may be the last time I modified the file; I really can't remember at this point.

Further information: In case you're puzzled by the file dates, I used XYPlorer to set the file creation, modification, and access dates to 8/8/2016 18:01 on files (in yet another attempt to outwit Apple's sorting scheme!).
To see the attached files, you need to log into the forum.

Post Reply