Put "Last modified time" in Date exif

Started by JojoBernard, October 21, 2015, 09:36:42 PM

Previous topic - Next topic

JojoBernard

Hello ,

I am new and it is complicated for me to understand because I 'm not English (and I know little :/).
I would take the image modification time and put in the date exif, but I do not know how the documentation is hard for me.

I know (for script/exiftool) :
Date (exif) = DateTimeOriginal
Date last modified = ModifyDate or FileModifyDate

like this ?
ExifTool "-DateTimeOriginal>FileModifyDate" C:\Users\account\Desktop\myPictures\*.jpg

Thx for help, I have to do that with 1100 Images


JojoBernard

Oh .. I found, it's simple haha

This code take the value of "datetimeoriginal" (exif) and put that value in "FileModifyDate"
ExifTool "-DateTimeOriginal>FileModifyDate" C:\Users\account\Desktop\myPictures\*.jpg


So I do the opposite direction to what I wanted
ExifTool "-FileModifyDate>DateTimeOriginal" C:\Users\account\Desktop\myPictures\*.jpg


but I have had mistakes and it did not work on some images



If you know why, thank you. I go to bed, it's late (4:00 am at home)

EDIT : We can do the same with the videos? (mp4)

Phil Harvey

Videos won't contain DateTimeOriginal, so you will probably have to use CreateDate instead.

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

JojoBernard

Ok !
I'll see how to videos.
This is data that was on my phone (android) and some data were not DateTimeOriginal (exif) then the data had the date of transfer CreateDate  instead of the DateTimeOriginal (exif) and therefore misplaced in the gallery. I noticed that FileModifyDate matched DateTimeOriginal (exif).

By cons, this is the organization (hierarchical) my files:
"C:\Users\eleve\Desktop\fusion\" = Main Folder
"C:\Users\eleve\Desktop\fusion\AAAA\" (contains images)
"C:\Users\eleve\Desktop\fusion\BBBB\" (contains folders)
"C:\Users\eleve\Desktop\fusion\BBBB\ZZZZ" (contains images)
"C:\Users\eleve\Desktop\fusion\BBBB\YYYYY" (contains images)
"C:\Users\eleve\Desktop\fusion\BBBB\WWWW" (contains images + folder)
"C:\Users\eleve\Desktop\fusion\BBBB\WWWW\KKKKK"
"C:\Users\eleve\Desktop\fusion\CCCC\" (contains images + folder)
...

I have to do :
exiftool "-FileModifyDate>DateTimeOriginal" "C:\Users\eleve\Desktop\fusion\AAAA\*.jpg"
exiftool "-FileModifyDate>DateTimeOriginal" "C:\Users\eleve\Desktop\fusion\BBBB\ZZZZ\*.jpg"
exiftool "-FileModifyDate>DateTimeOriginal" "C:\Users\eleve\Desktop\fusion\BBBB\WWWW\*.jpg"
exiftool "-FileModifyDate>DateTimeOriginal" "C:\Users\eleve\Desktop\fusion\BBBB\WWWW\KKKKK\*.jpg"
exiftool -delete_original "C:\Users\eleve\Desktop\fusion\BBBB\WWWW\KKKKK\*.jpg"


There is a faster way to do this treatment in all folders in the folder main ?
exiftool "-FileModifyDate>DateTimeOriginal" "C:\Users\eleve\Desktop\fusion\ ALL FOLDERS ALL IMAGES
exiftool -delete_original "C:\Users\eleve\Desktop\fusion\ ALL FOLDERS

Phil Harvey

Try this:

exiftool "-FileModifyDate>DateTimeOriginal" -ext jpg -r -overwrite_original "C:\Users\eleve\Desktop\fusion"

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

JojoBernard

Here is the command I used :
exiftool "-FileModifyDate>DateTimeOriginal" -ext jpg -ext jpeg -ext png -r -P -overwrite_original "C:\Users\eleve\Desktop\fusion"
It worked perfectly ! Except for png : "Creating non-standard EXIF in PNG".

Thank you for your help and for creating this program, it is really very useful.  :)

Phil Harvey

For PNG you should use CreationTime.  See the PNG Tags documentation for a complete list.

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

JojoBernard

Thank you, That's perfect!

Here are the commands used for those wanting to make the same thing:
exiftool "-FileModifyDate>DateTimeOriginal" -ext jpg -ext jpeg -r -P -overwrite_original "C:\Users\eleve\Desktop\fusion"
exiftool "-FileModifyDate>CreationTime" -ext png -r -P -overwrite_original "C:\Users\eleve\Desktop\fusion"