Mark files with missing DateTimeOriginal field

Started by ULSWK, February 16, 2015, 01:04:14 PM

Previous topic - Next topic

StarGeek

Quote from: Phil Harvey on February 17, 2015, 03:01:09 PM
Cool.  That is a very useful tip that I didn't know about.  And I couldn't ever figure out how to cut and paste from the cmd window.

I had forgotten but it's available with Vista and newer, not XP.  But I think it can be downloaded in that case.

Windows command line is just so annoying when it comes to copy and pasting.  There are a lot of replacements that add this functionality, but MS can't seem to do it themselves.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Quote from: ULSWK on February 17, 2015, 04:45:18 PM
Can you help me to solve this confusion ?

FAQ 3 helps with the problem of trying to figure out what metadata is displayed by other software.

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

ULSWK

Sure. Please find it attached.
I attached the bridge information as well.
I posted the photos in low resolution due to my bandwith. You can see that the photo has been exported a frew minutes ago (green mark) and the two original (red marked) creation dates.

StarGeek

I see a few differences in the date and time stamps.  The second picture that shows the date in Bridge has XMP:DateCreated, GPS:GPSTimeStamp, GPS:GPSDateStamp, IPTC:DateCreated, and IPTC:TimeCreated tags.  The first picture doesn't have these tags.

I created three copies of the first picture and copied the DateTimeOriginal into these missing tags.  Load them up in Bridge and see if any of them now show the DateTimeOriginal in it (I'm guessing it will be the xmp one).

XMP Changed : https://www.dropbox.com/s/6i16hw18nu5u0ws/XMP_20141007_61_6303.jpg
IPTC Changed : https://www.dropbox.com/s/lm2u0tulfc7wzwa/IPTC_20141007_61_6303.jpg
GPS Changed : https://www.dropbox.com/s/1e95c56t098t8xw/GPS_20141007_61_6303.jpg

Here are the commands I used.  If any of these show up properly, you can use the appropriate command to fix the rest of the files.

exiftool -overwrite_original "-XMP:DateCreated<DateTimeOriginal"

exiftool -overwrite_original "-IPTC:TimeCreated<DateTimeOriginal" "-IPTC:DateCreated<DateTimeOriginal"

exiftool -overwrite_original "-GPSTimeStamp<DateTimeOriginal" "-GPSDateStamp<DateTimeOriginal"
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ULSWK

That is interessing !
The file change date (marked blue) differs by some seconds because you saved the files one after each other, but the shown creation dates (marked red again) are equal for all three files.
Does this mean that bridge is showing different tags there, depending on what it can find in the file ??

ULSWK

An Addition to my last post:
Maybe I found a bug or at least strange behaviour of bridge.
I did some additional test on a small test directory with 38 files with this batch:

cls
@echo on
D:\#BV\TOOLS\EXIFTOOL\exiftool  -Overwrite_Original -Keywords+=AddDateTimeOriginal -if "not defined $datetimeoriginal or  $datetimeoriginal =~ /(^\s*$)/" "D:\#B\TEST\*.*"
D:\#BV\TOOLS\EXIFTOOL\exiftool  -Overwrite_Original -Keywords+=XMP_DateCreated -if "not defined $XMP:DateCreated or $XMP:DateCreated =~ /(^\s*$)/" "D:\#B\TEST\*.*"
D:\#BV\TOOLS\EXIFTOOL\exiftool  -Overwrite_Original -Keywords+=IPTC_TimeCreated -if "not defined $IPTC:TimeCreated or $IPTC:TimeCreated =~ /(^\s*$)/" "D:\#B\TEST\*.*"
pause


1.
The file I was missing the datestamp obviously has the datetimecreation date (as phil found out), but not the IPTC nor the XMP date stamps.

2.
After running the batch (and adding the keywords - and only the keywords - this way), bridge shows the date I was missing !! at the expected place (marked green in the attachmend)

A very strange behaviour, but I will find out how to handle this.

3.
Exiftool scanned all files twice !
I guess this is related to my "OR" statment. This causes doubled assigned keywords, can you please give me a hint how to supress that ? Two equal keywords in a file is not so nice.

ULSWK

Another question:

By the way, thank you very very much for your great advice !! This thread is very helpful for me. !!!

Most of my files have a correct date in the filename. like: YYYYDDMM_xx_#### where YYYYDDMM is the date, xx is a type sign and #### a number

Is it possible to assign the first 8 chars of the filename to the datetimecreation field ? This would reduce the amount of typo work.

Phil Harvey

Quote from: ULSWK on February 18, 2015, 06:37:38 AM
Most of my files have a correct date in the filename. like: YYYYDDMM_xx_#### where YYYYDDMM is the date, xx is a type sign and #### a number

Is it possible to assign the first 8 chars of the filename to the datetimecreation field ? This would reduce the amount of typo work.

Almost this exact question was asked and answered yesterday in this thread.  The only difference is that you would use s/_.*// instead of s/-.*// since you are using an underline at the end of the date/time part.

- Phil

Edit:  Oops.  Did you really mean YYYYDDMM, not YYYYMMDD?  Re-arranging the order is possible, but the expression would be more complicated: s/(\d{4})(\d{2})(\d{2}).*/$1$3$2/
...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

Quote from: ULSWK on February 18, 2015, 05:37:04 AM
2.
After running the batch (and adding the keywords - and only the keywords - this way), bridge shows the date I was missing !! at the expected place (marked green in the attachmend)

A very strange behaviour, but I will find out how to handle this.

Does Bridge have a reload metadata function?  It sounds like when these files were first imported, it didn't grab the info for some reason.  When you made a change, it reloaded all the info.

If Bridge doesn't have a reload function, on a different file that still doesn't show the date, try this command.  It will add one second to the system FileModifyDate, making it look like the file has been updated.  That might trick Bridge into thinking the file has been changed and needs to be updated

exiftool -FileModifyDate+="0:0:1" FILE



Quote3. Exiftool scanned all files twice !
I guess this is related to my "OR" statment. This causes doubled assigned keywords, can you please give me a hint how to supress that ? Two equal keywords in a file is not so nice.

That shouldn't be the case.  It should only add the keyword once regardless of how many ORs are in the condition.   But if you run it again without fixing the missing tag, it will add another copy of the keyword.  Run the command 5 times and you'll have 5 copies of the keyword.  To avoid multiple copies with multiple runs, you can either add another condition to the IF statement (like or keywords!~/AddDateTimeOriginal|XMP_DateCreated|IPTC_TimeCreated/) or the example in FAQ 17 (scroll down to where it says "To prevent duplication").
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ULSWK

Hi StarGeek,
yes, it is possible to reload the metadata in bridge but it ends up with the same values as before.
I'll try to find out about that in a adobe forum.
Perhaps someone knows the behaviour rules. I guess try and error might take a while...

Regarding the doubled keywords: Your statement "or keywords!~/AddDateTimeOriginal|XMP_DateCreated|IPTC_TimeCreated/)" seems to work fine.
Thank you !!