When i was importing my photos from my ipad to my hard disk i mistakenly imported them with the creation date of that day.
So now the true date for each photo is the modified date of it. I basically use this command to Setfile -d "$(GetFileInfo -m _FILE_PATH_)" _FILE_PATH_
to set the creation date of my photo to its modified date. But i was wondering if there is a way to put this command line in a python script where i can batch select multiple photos to preform this action.
Also, since if I open any photo the system will change its modified date, the only way that i can guess which date some photos belong to is by sorting them by name to see which date the photos before and after it belong to.
Any ideas on how I can write a script that deduces the real date of photos which have dates larger than a specific date based on the photos before and after it?
For example, you see in the screenshot that there is a photo from May 8 between two photos from October 5, so clearly it should be taken on October 5 as well.
But unfortunately sometimes the modified date of the photos before and after a photo are also wrong so I think the program has to look for the smallest date before and after the photo to deduce the real date.
UPDATE
I wrote this code on the python and it works fine for single files when I drag and drop them into the terminal to give the program the path. Im wondering if there is a way to do this with multiple files.
from subprocess import call
import os
path = input("enter filepath: ")
info = '"$(GetFileInfo -m '+ path + ')" '
command = 'Setfile -d ' + info + path
print('Setfile -d ' + info + path)
call(command, shell=True)